==Oberon-2==
'''TODO:'''
=={{header|PureBasic}}==
<lang PureBasic>*memoryBlock = AllocateMemory(1000) ;allocate 1000 bytes
*resizedMemoryBlock = ReAllocateMemory(*memoryBlock, 2000) ;attempt to increase size of memory block
;make sure block was able to be reallocated, if it wasn't *memoryBlock value is still valid
If *resizedMemoryBlock <> 0
*memoryBlock = *resizedMemoryBlock
;set the now unused pointer to zero to be thorough
*resizedMemoryBlock = 0
EndIf
;this will also be done automatically and program end
FreeMemory(*memoryBlock) </lang>
Memory for strings is handled automatically from a separate memory heap. The automatic handling of string memory includes garbage collection and the freeing of string memory.
=={{header|PureBasic}}==
<lang PureBasic>*buffer=AllocateMemory(20)
|