Memory allocation: Difference between revisions
→{{header|Oforth}}
(Updated D entry) |
|||
Line 768:
foo_array := Int->New[size]; // allocates an integer array on the heap
x := 0; // allocates an integer on the stack</lang>
=={{header|Oforth}}==
All memory in Oforth is managed by the garbage collector. Objects are all allocated on the heap using new on a class.
Stack can't be accessed and objects are never allocated on the stack.
You can allocate a block of memory (on the heap) by creating a MemBuffer object, which is an array of bytes.
=={{header|PARI/GP}}==
|