The OpenD Programming Language

BitmappedBlock.allocate

Allocates s bytes of memory and returns it, or null if memory could not be allocated.

The following information might be of help with choosing the appropriate block size. Actual allocation occurs in sizes multiple of the block size. Allocating one block is the fastest because only one 0 bit needs to be found in the metadata. Allocating 2 through 64 blocks is the next cheapest because it affects a maximum of two ulong in the metadata. Allocations greater than 64 blocks require a multiword search through the metadata.

If instantiated with No.multiblock, it performs a search for the first zero bit in the bitmap and sets it.

Meta