RosettaCodeData/Task/Memory-allocation/Factor/memory-allocation-2.factor
2023-07-01 13:44:08 -04:00

6 lines
158 B
Factor

STRUCT: foo { a int } { b foo* } ;
[
foo malloc-struct &free ! gets freed at end of the current with-destructors scope
! do stuff
] with-destructors