Riferimenti per il file balloc.h

A block allocator. Continua...

#include "setup.h"
#include "client.h"
#include "tools.h"
#include "memory.h"
#include "ircd_defs.h"

Vai al codice sorgente di questo file.

Strutture dati

struct  Block
 Block contains status information for an allocated block in our heap. Continua...
struct  MemBlock
struct  BlockHeap
 BlockHeap contains the information for the root node of the memory heap. Continua...

Ridefinizioni di tipo (typedef)

typedef struct Block Block
typedef struct MemBlock MemBlock
typedef struct BlockHeap BlockHeap

Funzioni

int BlockHeapFree (BlockHeap *, void *)
 Returns an element to the free pool, does not free().
void * BlockHeapAlloc (BlockHeap *)
 Returns a pointer to a struct within our BlockHeap that's free for the taking.
BlockHeapBlockHeapCreate (const char *const, size_t, int)
 Creates a new blockheap.
int BlockHeapDestroy (BlockHeap *)
 Completely free()s a BlockHeap. Use for cleanup.
void initBlockHeap (void)
 Opens /dev/zero and saves the file handle for future allocations.
void block_heap_report_stats (struct Client *)


Descrizione dettagliata

A block allocator.

Versione:
Id
balloc.h 670 2006-06-12 12:20:55Z michael
Da fare:
Get rid of all typedefs in this file

Definizione nel file balloc.h.


Documentazione delle ridefinizioni di tipo (typedef)

typedef struct Block Block

Definizione alla linea 51 del file balloc.h.

typedef struct BlockHeap BlockHeap

Definizione alla linea 72 del file balloc.h.

typedef struct MemBlock MemBlock

Definizione alla linea 57 del file balloc.h.


Documentazione delle funzioni

void block_heap_report_stats ( struct Client  ) 

void* BlockHeapAlloc ( BlockHeap bh  ) 

Returns a pointer to a struct within our BlockHeap that's free for the taking.

Parametri:
bh Pointer to the Blockheap
Restituisce:
Address pointer to allocated data space, or NULL if unsuccessful

Definizione alla linea 258 del file balloc.c.

Riferimenti BlockHeap::base, BlockHeapGarbageCollect(), _dlink_node::data, dlinkDelete(), BlockHeap::elemSize, Block::free_list, Block::freeElems, BlockHeap::freeElems, _dlink_list::head, newblock(), Block::next, e outofmemory().

Referenziato da add_id(), add_user_host(), add_user_to_channel(), allocate_topic(), dbuf_alloc(), find_or_add_ip(), find_or_add_userhost(), make_channel(), make_client(), e make_dlink_node().

BlockHeap* BlockHeapCreate ( const char *const   name,
size_t  elemsize,
int  elemsperblock 
)

Creates a new blockheap.

Creates a new blockheap from which smaller blocks can be allocated. Intended to be used instead of multiple calls to malloc() when performance is an issue.

Parametri:
name Name of the blockheap
elemsize Size of the basic element to be stored
elemsperblock Number of elements to be stored in a single block of memory. When the blockheap runs out of free memory, it will allocate elemsize * elemsperblock more.
Restituisce:
Pointer to new BlockHeap, or NULL if unsuccessful

Definizione alla linea 211 del file balloc.c.

Riferimenti BlockHeap::elemSize, BlockHeap::elemsPerBlock, BlockHeap::name, newblock(), BlockHeap::next, e outofmemory().

Referenziato da dbuf_init(), init_channels(), init_client(), init_dlink_nodes(), init_hash(), e init_ip_hash_table().

int BlockHeapDestroy ( BlockHeap bh  ) 

Completely free()s a BlockHeap. Use for cleanup.

Parametri:
bh Pointer to the BlockHeap to be destroyed
Restituisce:
0 if successful, 1 if bh == NULL

Definizione alla linea 394 del file balloc.c.

Riferimenti Block::alloc_size, BlockHeap::base, Block::elems, free_block(), BlockHeap::next, e Block::next.

int BlockHeapFree ( BlockHeap bh,
void *  ptr 
)

Returns an element to the free pool, does not free().

Parametri:
bh Pointer to BlockHeap containing element
ptr Pointer to element to be "freed"
Restituisce:
0 if successful, 1 if element not contained within BlockHeap

Definizione alla linea 306 del file balloc.c.

Riferimenti MemBlock::block, dlinkAdd(), BlockHeap::elemSize, Block::free_list, Block::freeElems, BlockHeap::freeElems, mem_frob, outofmemory(), e MemBlock::self.

Referenziato da dbuf_delete(), delete_user_host(), destroy_channel(), free_client(), free_dlink_node(), free_topic(), garbage_collect_ip_entries(), remove_ban(), remove_one_ip(), e remove_user_from_channel().

void initBlockHeap ( void   ) 

Opens /dev/zero and saves the file handle for future allocations.

Definizione alla linea 107 del file balloc.c.

Riferimenti eventAdd(), fd_open(), heap_garbage_collection(), e outofmemory().

Referenziato da main().


Generato il Wed Apr 15 00:19:20 2009 per ircd-hybrid da  doxygen 1.5.6