whalloc  WhallocUses

Uses for whalloc

Some of the things i use the various whalloc classes for:

  • The whalloc_ht class and its successor, whalloc_bt, were originally written so that i could optimize libwhefs for better memory usage.
  • It turns out that it also allows me to set a hard memory limit for a given library's usage. That is useful for testing the out-of-memory error handling as well as giving clients a good degree of control over memory usage.
  • The whalloc_pager classes were originally written so that libwhio_epfs (the eventual successor to libwhefs) could efficiently manage the memory for lots of very small records which come and go quite often.

That said, using the standard allocators is, for most purposes, just fine. For certain projects, though, i like to squeeze as many bytes out of them as i can, and custom allocators can help do that. They're no magic bullet, but they certainly have their uses.