Gromacs  2020.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Typedefs | Functions
#include <cstddef>
+ Include dependency graph for mempool.h:
+ This graph shows which files directly or indirectly include this file:

Description

Declarations for memory pooling functions.

Todo:
Document these functions.

This is an implementation header: there should be no need to use it outside this directory.

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

Typedefs

typedef struct gmx_sel_mempool_t gmx_sel_mempool_t
 Opaque struct for memory pooling. 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, struct 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, struct gmx_ana_index_t *g)
 Convenience function for freeing an index group from a memory pool. More...
 

Typedef Documentation

Opaque struct for memory pooling.

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.