ForthOS Dynamic/Bucket Memory Allocator
Allocates "u" bytes of memory, and returns a pointer to this storage.
Like bkalloc, but the memory is zeroed.
Frees previously allocated memory.
Changes the allocation size of a previously allocated chunk of memory. Returns a (possibly changed) pointer to the contents. The contents through the lesser of the old and new sizes is preserved. After this call, only the returned pointer value should be used to access the memory.
The memory is organized in "buckets" which increase by powers of two. Thus, the actual memory consumed can be quite a bit larger than the size you actually requested. This scheme is used because it is much more resistant to memory fragmentation than "best fit" type allocators.