Memory allocation: Difference between revisions

Content added Content deleted
Line 836: Line 836:
...
...
free(addr)
free(addr)
atom addr2 = allocate(512,1) -- automatically freed when addr2 drops out of scope
atom addr2 = allocate(512,1) -- automatically freed when addr2 drops out of scope or re-assigned
atom addr3 = allocate_string("a string",1) -- automatically freed when addr3 drops out of scope</lang>
atom addr3 = allocate_string("a string",1) -- automatically freed when addr3 drops out of scope or re-assigned</lang>
Behind the scenes, the Phix stack is actually managed as a linked list of virtual stack blocks allocated on the heap, and as such it
Behind the scenes, the Phix stack is actually managed as a linked list of virtual stack blocks allocated on the heap, and as such it
would be utterly pointless and quite probably extremely tricky to mess with.
would be utterly pointless and quite probably extremely tricky to mess with.