Gromacs  2019-beta2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Macros | Typedefs | Functions
#include "gmxpre.h"
#include "mempool.h"
#include <cstdlib>
#include <new>
#include "gromacs/selection/indexutil.h"
#include "gromacs/utility/exceptions.h"
#include "gromacs/utility/gmxassert.h"
#include "gromacs/utility/smalloc.h"
+ Include dependency graph for mempool.cpp:

Description

Implements functions in mempool.h.

Author
Teemu Murtola teemu.nosp@m..mur.nosp@m.tola@.nosp@m.gmai.nosp@m.l.com

Classes

struct  gmx_sel_mempool_block_t
 Describes a single block allocated from the memory pool. More...
 
struct  gmx_sel_mempool_t
 Describes a memory pool. More...
 

Macros

#define ALIGN_STEP   8
 Alignment in bytes for all returned blocks.
 

Typedefs

typedef struct
gmx_sel_mempool_block_t 
gmx_sel_mempool_block_t
 Describes a single block allocated from the memory pool. More...
 

Functions

gmx_sel_mempool_t_gmx_sel_mempool_create ()
 Create an empty memory pool. More...
 
void _gmx_sel_mempool_destroy (gmx_sel_mempool_t *mp)
 Destroy a memory pool. More...
 
void * _gmx_sel_mempool_alloc (gmx_sel_mempool_t *mp, size_t size)
 Allocate memory from a memory pool. More...
 
void _gmx_sel_mempool_free (gmx_sel_mempool_t *mp, void *ptr)
 Release memory allocated from a memory pool. More...
 
void _gmx_sel_mempool_reserve (gmx_sel_mempool_t *mp, size_t size)
 Set the size of a memory pool. More...
 
void _gmx_sel_mempool_alloc_group (gmx_sel_mempool_t *mp, gmx_ana_index_t *g, int isize)
 Convenience function for allocating an index group from a memory pool. More...
 
void _gmx_sel_mempool_free_group (gmx_sel_mempool_t *mp, gmx_ana_index_t *g)
 Convenience function for freeing an index group from a memory pool. More...
 

Typedef Documentation

Describes a single block allocated from the memory pool.

Function Documentation

void* _gmx_sel_mempool_alloc ( gmx_sel_mempool_t mp,
size_t  size 
)

Allocate memory from a memory pool.

void _gmx_sel_mempool_alloc_group ( gmx_sel_mempool_t mp,
struct gmx_ana_index_t g,
int  isize 
)

Convenience function for allocating an index group from a memory pool.

gmx_sel_mempool_t* _gmx_sel_mempool_create ( )

Create an empty memory pool.

void _gmx_sel_mempool_destroy ( gmx_sel_mempool_t mp)

Destroy a memory pool.

void _gmx_sel_mempool_free ( gmx_sel_mempool_t mp,
void *  ptr 
)

Release memory allocated from a memory pool.

void _gmx_sel_mempool_free_group ( gmx_sel_mempool_t mp,
struct gmx_ana_index_t g 
)

Convenience function for freeing an index group from a memory pool.

void _gmx_sel_mempool_reserve ( gmx_sel_mempool_t mp,
size_t  size 
)

Set the size of a memory pool.