isc_memmethods Struct Reference

isc_mem_putanddetach() is a convenience function for use where you have a structure with an attached memory context. More...

#include <mem.h>


Data Fields

void(* attach )(isc_mem_t *source, isc_mem_t **targetp)
void(* detach )(isc_mem_t **mctxp)
void(* destroy )(isc_mem_t **mctxp)
void *(* memget )(isc_mem_t *mctx, size_t size _ISC_MEM_FLARG)
void(* memput )(isc_mem_t *mctx, void *ptr, size_t size _ISC_MEM_FLARG)
void(* memputanddetach )(isc_mem_t **mctxp, void *ptr, size_t size _ISC_MEM_FLARG)
void *(* memallocate )(isc_mem_t *mctx, size_t size _ISC_MEM_FLARG)
void *(* memreallocate )(isc_mem_t *mctx, void *ptr, size_t size _ISC_MEM_FLARG)
char *(* memstrdup )(isc_mem_t *mctx, const char *s _ISC_MEM_FLARG)
void(* memfree )(isc_mem_t *mctx, void *ptr _ISC_MEM_FLARG)
void(* setdestroycheck )(isc_mem_t *mctx, isc_boolean_t flag)
void(* setwater )(isc_mem_t *ctx, isc_mem_water_t water, void *water_arg, size_t hiwater, size_t lowater)
void(* waterack )(isc_mem_t *ctx, int flag)
size_t(* inuse )(isc_mem_t *mctx)
size_t(* maxinuse )(isc_mem_t *mctx)
size_t(* total )(isc_mem_t *mctx)
isc_boolean_t(* isovermem )(isc_mem_t *mctx)
isc_result_t(* mpcreate )(isc_mem_t *mctx, size_t size, isc_mempool_t **mpctxp)


Detailed Description

isc_mem_putanddetach() is a convenience function for use where you have a structure with an attached memory context.

Given:

 struct {
        ...
        isc_mem_t *mctx;
        ...
 } *ptr;

 isc_mem_t *mctx;

 isc_mem_putanddetach(&ptr->mctx, ptr, sizeof(*ptr));

is the equivalent of:

 mctx = NULL;
 isc_mem_attach(ptr->mctx, &mctx);
 isc_mem_detach(&ptr->mctx);
 isc_mem_put(mctx, ptr, sizeof(*ptr));
 isc_mem_detach(&mctx);

memory and memory pool methods

Definition at line 203 of file mem.h.


Field Documentation

void(* isc_memmethods::attach)(isc_mem_t *source, isc_mem_t **targetp)

void(* isc_memmethods::detach)(isc_mem_t **mctxp)

void(* isc_memmethods::destroy)(isc_mem_t **mctxp)

void*(* isc_memmethods::memget)(isc_mem_t *mctx, size_t size _ISC_MEM_FLARG)

void(* isc_memmethods::memput)(isc_mem_t *mctx, void *ptr, size_t size _ISC_MEM_FLARG)

void(* isc_memmethods::memputanddetach)(isc_mem_t **mctxp, void *ptr, size_t size _ISC_MEM_FLARG)

void*(* isc_memmethods::memallocate)(isc_mem_t *mctx, size_t size _ISC_MEM_FLARG)

void*(* isc_memmethods::memreallocate)(isc_mem_t *mctx, void *ptr, size_t size _ISC_MEM_FLARG)

char*(* isc_memmethods::memstrdup)(isc_mem_t *mctx, const char *s _ISC_MEM_FLARG)

void(* isc_memmethods::memfree)(isc_mem_t *mctx, void *ptr _ISC_MEM_FLARG)

void(* isc_memmethods::setdestroycheck)(isc_mem_t *mctx, isc_boolean_t flag)

void(* isc_memmethods::setwater)(isc_mem_t *ctx, isc_mem_water_t water, void *water_arg, size_t hiwater, size_t lowater)

void(* isc_memmethods::waterack)(isc_mem_t *ctx, int flag)

size_t(* isc_memmethods::inuse)(isc_mem_t *mctx)

size_t(* isc_memmethods::maxinuse)(isc_mem_t *mctx)

size_t(* isc_memmethods::total)(isc_mem_t *mctx)

isc_boolean_t(* isc_memmethods::isovermem)(isc_mem_t *mctx)

isc_result_t(* isc_memmethods::mpcreate)(isc_mem_t *mctx, size_t size, isc_mempool_t **mpctxp)


The documentation for this struct was generated from the following file:
Generated on Tue Apr 28 17:41:20 2015 by Doxygen 1.5.4 for BIND9 Internals 9.11.0pre-alpha