RosettaCodeData/Task/Memory-allocation/Factor/memory-allocation-2.factor

7 lines
158 B
Factor
Raw Permalink Normal View History

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