Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

halloc.c File Reference


Detailed Description

Hashtable-tracked allocator.

Small chunks are allocated via walloc(), whereas large chunks are served via alloc_pages(). The interface is the same as that of malloc()/free(). The hashtable keeps track of the sizes which should gain a more compact memory layout and is considered more cache-friendly. alloc_pages() may cause an overhead up to (pagesize - 1) per allocation. The advantage is that the pages will be unmapped on hfree().

Define USE_HALLOC to use this instead of the default memory allocation functions used.

Author:
Christian Biere
Date:
2006

#include "common.h"
#include "halloc.h"
#include "hashtable.h"
#include "pagetable.h"
#include "misc.h"
#include "malloc.h"
#include "walloc.h"
#include "glib-missing.h"
#include "override.h"

Functions

void halloc_init (void)
void hdestroy (void)
size_t halloc_bytes_allocated (void)
size_t halloc_chunks_allocated (void)

Variables

size_t bytes_allocated
size_t chunks_allocated


Function Documentation

size_t halloc_bytes_allocated void   ) 
 

size_t halloc_chunks_allocated void   ) 
 

void halloc_init void   ) 
 

void hdestroy void   ) 
 


Variable Documentation

size_t bytes_allocated [static]
 

size_t chunks_allocated [static]
 


Generated on Sat Jun 30 17:53:27 2007 for gtk-gnutella by  doxygen 1.3.9.1