Gromacs
2020.4
|
#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"
Implements functions in mempool.h.
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 struct gmx_sel_mempool_block_t gmx_sel_mempool_block_t |
Describes a single block allocated from the memory pool.
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.