libarena

libarena is a custom memory allocator interface and implementation.
Download

libarena Ranking & Summary

Advertisement

  • Rating:
  • License:
  • MIT/X Consortium Lic...
  • Price:
  • FREE
  • Publisher Name:
  • William Ahern
  • Publisher web site:
  • http://25thandclement.com/~william/projects/zoned.html

libarena Tags


libarena Description

libarena is a custom memory allocator interface and implementation. libarena library is a custom memory allocator interface and implementation. Three allocators are provided: flat "LIFO" arena allocator, object pool allocator and a malloc(3) wrapper. These can be used directly, or through their exported prototype interfaces. libarena is meant to provide a baseline interface so allocator's can be stacked, and to provide a well defined interface for libraries and applications. It is not meant to restrict or confine what custom allocators can actually accomplish. For instance, the included pool and arena allocators include a suite of string utilities which aren't available in the generic exportable interface. However, they are built upon the generic interface (see util.h). Almost no malloc(3) library "replacements" support a context pointer argument. They're useless for many or most of the tasks where the ability to specify an alternate malloc(3) could actually be useful, e.g. one shot dealloction of a task structure and all associated allocations. For network daemons especially this feature is useful; all allocations for a particular session can be freed simply by closing the lowest-level allocator object. The arena allocator behaves similarly to GNU obstacks. If allocations are freed in reverse order than the underlying buffers will be freed accordingly; out-of-order deallocations will lead to fragmentation. The arena allocator also supports position marking. The state at any given instance can be stored and the allocator later reset to that state. All allocations which occured after, in time, the saved state will behave as-if they were explicitly deallocated. The pool allocator keeps a pool of sets of fixed sized buffers. Each buffer size can be arbitrary. Allocations which cannot be met from the existing buckets will result in the creation of a new bucket. Memory returned to the pool will be reused. Currently the pool will never shrink, only grow. Upon closing of the arena or pool allocator objects all memory used will be released back to their underlying allocator (either the one passed on instantiation, or by default `ARENA_STDLIB', the standard library wrapper.What's New in This Release:· The makefiles are no longer recursive, so this should build and install using either GNU Make or BSD pmake.


libarena Related Software