whalloc  Update of "whalloc_region"

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.


Artifact ID: 13eb511eedff2414ae436343769efbd8273a66c9
Page Name:whalloc_region
Date: 2010-02-27 14:20:19
Original User: stephan

The whalloc_region API

Files: whalloc.h, whalloc_region.c

The "region" API is a trivial allocator which manages allocation from a client-defined block of memory. It can only allocate, not deallocate, individual objects.

It looks something like this:

whalloc_region r = whalloc_region_empty;
whalloc_region_init(r, myMemory, sizeOfMyMemory );
void * x = whalloc_region_alloc( &r, sizeOfMyMemory/2 );
// To free all items at once:
whalloc_region_free( &r );

Trivia: unlike whalloc_bt and whalloc_ht, this allocator may allocate more than (2^WHALLOC_BITNESS-1) bytes in a single allocation.