Blender V2.61 - r43446
Classes | Defines | Typedefs | Functions

BLI_mempool.c File Reference

#include "BLI_utildefines.h"
#include "BLI_listbase.h"
#include "BLI_mempool.h"
#include "DNA_listBase.h"
#include "MEM_guardedalloc.h"
#include <string.h>
#include <stdlib.h>

Go to the source code of this file.

Classes

struct  BLI_freenode
struct  BLI_mempool_chunk
struct  BLI_mempool

Defines

#define MAKE_ID(a, b, c, d)   ( (int)(d)<<24 | (int)(c)<<16 | (b)<<8 | (a) )
#define FREEWORD   MAKE_ID('f', 'r', 'e', 'e')
#define MEMPOOL_ELEM_SIZE_MIN   (sizeof(void *) * 2)

Typedefs

typedef struct BLI_freenode BLI_freenode
typedef struct BLI_mempool_chunk BLI_mempool_chunk

Functions

BLI_mempoolBLI_mempool_create (int esize, int tote, int pchunk, short use_sysmalloc, short allow_iter)
void * BLI_mempool_alloc (BLI_mempool *pool)
void * BLI_mempool_calloc (BLI_mempool *pool)
void BLI_mempool_free (BLI_mempool *pool, void *addr)
void * BLI_mempool_findelem (BLI_mempool *pool, int index)
void BLI_mempool_iternew (BLI_mempool *pool, BLI_mempool_iter *iter)
void * BLI_mempool_iterstep (BLI_mempool_iter *iter)
void BLI_mempool_destroy (BLI_mempool *pool)

Detailed Description

Definition in file BLI_mempool.c.


Define Documentation

#define FREEWORD   MAKE_ID('f', 'r', 'e', 'e')
#define MAKE_ID (   a,
  b,
  c,
 
)    ( (int)(d)<<24 | (int)(c)<<16 | (b)<<8 | (a) )

Definition at line 54 of file BLI_mempool.c.

#define MEMPOOL_ELEM_SIZE_MIN   (sizeof(void *) * 2)

Definition at line 82 of file BLI_mempool.c.

Referenced by BLI_mempool_create().


Typedef Documentation

typedef struct BLI_freenode BLI_freenode

Function Documentation

void* BLI_mempool_alloc ( BLI_mempool pool)
void* BLI_mempool_calloc ( BLI_mempool pool)

Definition at line 194 of file BLI_mempool.c.

References BLI_mempool_alloc(), and BLI_mempool::esize.

Referenced by CustomData_bmesh_alloc_block().

BLI_mempool* BLI_mempool_create ( int  esize,
int  tote,
int  pchunk,
short  use_sysmalloc,
short  allow_iter 
)
void BLI_mempool_destroy ( BLI_mempool pool)
void* BLI_mempool_findelem ( BLI_mempool pool,
int  index 
)
void BLI_mempool_free ( BLI_mempool pool,
void *  addr 
)
void BLI_mempool_iternew ( BLI_mempool pool,
BLI_mempool_iter iter 
)
void* BLI_mempool_iterstep ( BLI_mempool_iter iter)