mem.h revision ab023a65562e62b85a824509d829b6fad87e00b1
d362465c77b375be2707bc83cebc731d0645d12dAutomatic Updater * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
499b34cea04a46823d003d4c0520c8b03e8513cbBrian Wellington * Copyright (C) 1997-2001 Internet Software Consortium.
ec5347e2c775f027573ce5648b910361aa926c01Automatic Updater * Permission to use, copy, modify, and distribute this software for any
138d22b316c7cd10eaa9df2ee0e3ec712a077153Bob Halley * purpose with or without fee is hereby granted, provided that the above
138d22b316c7cd10eaa9df2ee0e3ec712a077153Bob Halley * copyright notice and this permission notice appear in all copies.
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * PERFORMANCE OF THIS SOFTWARE.
5388178e8aa12c263286caa394491903cbf9806eMark Andrews/* $Id: mem.h,v 1.61 2005/04/27 04:57:19 sra Exp $ */
3a34b87c878990c6303358efd22265c2c5980c65Mark Andrewstypedef void (*isc_mem_water_t)(void *, int);
3a34b87c878990c6303358efd22265c2c5980c65Mark Andrewstypedef void * (*isc_memalloc_t)(void *, size_t);
ac70da9a2710aa9f343d2f720eb1bdd4191a79caBob Halleytypedef void (*isc_memfree_t)(void *, void *);
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * Define ISC_MEM_DEBUG=1 to make all functions that free memory
18159f6f6053de21e433f2194ca4f89b96926c09Andreas Gustafsson * set the pointer being freed to NULL after being freed.
18159f6f6053de21e433f2194ca4f89b96926c09Andreas Gustafsson * This is the default; set ISC_MEM_DEBUG=0 to disable it.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * Define ISC_MEM_TRACKLINES=1 to turn on detailed tracing of memory
18159f6f6053de21e433f2194ca4f89b96926c09Andreas Gustafsson * allocation and freeing by file and line number.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * Define ISC_MEM_CHECKOVERRUN=1 to turn on checks for using memory outside
c52e5c8ed1e2a3a90b912d3e4cb5da9dc32d85f7Andreas Gustafsson * the requested space. This will increase the size of each allocation.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * Define ISC_MEM_FILL=1 to fill each block of memory returned to the system
18159f6f6053de21e433f2194ca4f89b96926c09Andreas Gustafsson * with the byte string '0xbe'. This helps track down uninitialized pointers
bfab56849df65a2d4295b256808a66985cfa9d98Michael Graff * and the like. On freeing memory, the space is filled with '0xde' for
bfab56849df65a2d4295b256808a66985cfa9d98Michael Graff * the same reasons.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * Define ISC_MEMPOOL_NAMES=1 to make memory pools store a symbolic
18159f6f6053de21e433f2194ca4f89b96926c09Andreas Gustafsson * name so that the leaking pool can be more readily identified in
18159f6f6053de21e433f2194ca4f89b96926c09Andreas Gustafsson * case of a memory leak.
bfab56849df65a2d4295b256808a66985cfa9d98Michael GraffLIBISC_EXTERNAL_DATA extern unsigned int isc_mem_debugging;
d4d68515d23668cfe804ab2a174a7e427decedd8Mark Andrews * The variable isc_mem_debugging holds a set of flags for
d4d68515d23668cfe804ab2a174a7e427decedd8Mark Andrews * turning certain memory debugging options on or off at
d4d68515d23668cfe804ab2a174a7e427decedd8Mark Andrews * runtime. Its is intialized to the value ISC_MEM_DEGBUGGING,
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * which is 0 by default but may be overridden at compile time.
6d858e75d4f411e89485ec702ce1e118e1ead53cAndreas Gustafsson * The following flags can be specified:
0ef59d22882fc5d28f4683fdbe88aefd8eaad6f3Francis Dupont * \li #ISC_MEM_DEBUGTRACE
6d858e75d4f411e89485ec702ce1e118e1ead53cAndreas Gustafsson * Log each allocation and free to isc_lctx.
6d858e75d4f411e89485ec702ce1e118e1ead53cAndreas Gustafsson * \li #ISC_MEM_DEBUGRECORD
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * Remember each allocation, and match them up on free.
6d858e75d4f411e89485ec702ce1e118e1ead53cAndreas Gustafsson * Crash if a free doesn't match an allocation.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * \li #ISC_MEM_DEBUGUSAGE
6d858e75d4f411e89485ec702ce1e118e1ead53cAndreas Gustafsson * If a hi_water mark is set, print the maximium inuse memory
6d858e75d4f411e89485ec702ce1e118e1ead53cAndreas Gustafsson * every time it is raised once it exceeds the hi_water mark.
d4d68515d23668cfe804ab2a174a7e427decedd8Mark Andrews#define _ISC_MEM_FLARG , const char *, int
d4d68515d23668cfe804ab2a174a7e427decedd8Mark Andrews#define isc_mem_get(c, s) isc__mem_get((c), (s) _ISC_MEM_FILELINE)
6d858e75d4f411e89485ec702ce1e118e1ead53cAndreas Gustafsson#define isc_mem_allocate(c, s) isc__mem_allocate((c), (s) _ISC_MEM_FILELINE)
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein#define isc_mem_strdup(c, p) isc__mem_strdup((c), (p) _ISC_MEM_FILELINE)
bfab56849df65a2d4295b256808a66985cfa9d98Michael Graff#define isc_mempool_get(c) isc__mempool_get((c) _ISC_MEM_FILELINE)
5388178e8aa12c263286caa394491903cbf9806eMark Andrews * isc_mem_putanddetach() is a convienence function for use where you
bfab56849df65a2d4295b256808a66985cfa9d98Michael Graff * have a structure with an attached memory context.
016c0a82f1ce3fe4d362d7c9cf8de4377ffaf5a9Mark Andrews * isc_mem_t *mctx;
016c0a82f1ce3fe4d362d7c9cf8de4377ffaf5a9Mark Andrews * isc_mem_t *mctx;
016c0a82f1ce3fe4d362d7c9cf8de4377ffaf5a9Mark Andrews * isc_mem_putanddetach(&ptr->mctx, ptr, sizeof(*ptr));
016c0a82f1ce3fe4d362d7c9cf8de4377ffaf5a9Mark Andrews * is the equivalent of:
5597be9bb88de138dfec9fa9176708443813925eTatuya JINMEI 神明達哉 * mctx = NULL;
5597be9bb88de138dfec9fa9176708443813925eTatuya JINMEI 神明達哉 * isc_mem_attach(ptr->mctx, &mctx);
5597be9bb88de138dfec9fa9176708443813925eTatuya JINMEI 神明達哉 * isc_mem_detach(&ptr->mctx);
016c0a82f1ce3fe4d362d7c9cf8de4377ffaf5a9Mark Andrews * isc_mem_put(mctx, ptr, sizeof(*ptr));
016c0a82f1ce3fe4d362d7c9cf8de4377ffaf5a9Mark Andrews * isc_mem_detach(&mctx);
016c0a82f1ce3fe4d362d7c9cf8de4377ffaf5a9Mark Andrews#define isc_mem_put(c, p, s) \
457144a0c69e0aa242386f35498e41dc8bfc1610Tatuya JINMEI 神明達哉 isc__mem_put((c), (p), (s) _ISC_MEM_FILELINE); \
457144a0c69e0aa242386f35498e41dc8bfc1610Tatuya JINMEI 神明達哉 isc__mem_putanddetach((c), (p), (s) _ISC_MEM_FILELINE); \
82629edf81d6ce977440eb5ce3314cdeb0fa14daEvan Hunt#define isc_mempool_put(c, p) \
82629edf81d6ce977440eb5ce3314cdeb0fa14daEvan Hunt#define isc_mem_put(c, p, s) isc__mem_put((c), (p), (s) _ISC_MEM_FILELINE)
82629edf81d6ce977440eb5ce3314cdeb0fa14daEvan Hunt#define isc_mem_putanddetach(c, p, s) \
82629edf81d6ce977440eb5ce3314cdeb0fa14daEvan Hunt isc__mem_putanddetach((c), (p), (s) _ISC_MEM_FILELINE)
82629edf81d6ce977440eb5ce3314cdeb0fa14daEvan Hunt#define isc_mem_free(c, p) isc__mem_free((c), (p) _ISC_MEM_FILELINE)
54ef500660da1f4e8d4e14e737fa81c4c881ac0aBrian Wellington#define isc_mempool_put(c, p) isc__mempool_put((c), (p) _ISC_MEM_FILELINE)
6c6bed90cb5b51a90530b7d488b2696626a8fafcMark Andrewsisc_mem_create(size_t max_size, size_t target_size,
6c6bed90cb5b51a90530b7d488b2696626a8fafcMark Andrewsisc_mem_createx(size_t max_size, size_t target_size,
6c6bed90cb5b51a90530b7d488b2696626a8fafcMark Andrews isc_memalloc_t memalloc, isc_memfree_t memfree,
6c6bed90cb5b51a90530b7d488b2696626a8fafcMark Andrews * \brief Create a memory context.
6c6bed90cb5b51a90530b7d488b2696626a8fafcMark Andrews * 'max_size' and 'target_size' are tuning parameters. When
6c6bed90cb5b51a90530b7d488b2696626a8fafcMark Andrews * ISC_MEM_USE_INTERNAL_MALLOC is true, allocations smaller than
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * 'max_size' will be satisfied by getting blocks of size
6c6bed90cb5b51a90530b7d488b2696626a8fafcMark Andrews * 'target_size' from the system allocator and breaking them up into
6c6bed90cb5b51a90530b7d488b2696626a8fafcMark Andrews * pieces; larger allocations will use the system allocator directly.
6c6bed90cb5b51a90530b7d488b2696626a8fafcMark Andrews * If 'max_size' and/or 'target_size' are zero, default values will be
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * used. When ISC_MEM_USE_INTERNAL_MALLOC is false, 'target_size' is
6c6bed90cb5b51a90530b7d488b2696626a8fafcMark Andrews * 'max_size' is also used to size the statistics arrays and the array
6c6bed90cb5b51a90530b7d488b2696626a8fafcMark Andrews * used to record active memory when ISC_MEM_DEBUGRECORD is set. Settin
6c6bed90cb5b51a90530b7d488b2696626a8fafcMark Andrews * 'max_size' too low can have detrimental effects on performance.
6c6bed90cb5b51a90530b7d488b2696626a8fafcMark Andrews * A memory context created using isc_mem_createx() will obtain
6c6bed90cb5b51a90530b7d488b2696626a8fafcMark Andrews * memory from the system by calling 'memalloc' and 'memfree',
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉 * passing them the argument 'arg'. A memory context created
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉 * using isc_mem_create() will use the standard library malloc()
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉 * mctxp != NULL && *mctxp == NULL */
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉 * \brief Attach to / detach from a memory context.
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉 * This is intended for applications that use multiple memory contexts
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉 * in such a way that it is not obvious when the last allocations from
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉 * a given context has been freed and destroying the context is safe.
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉 * Most applications do not need to call these functions as they can
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉 * simply create a single memory context at the beginning of main()
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉 * and destroy it at the end of main(), thereby guaranteeing that it
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉 * is not destroyed while there are outstanding allocations.
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉 * Destroy a memory context.
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉 * Request to be notified with an event when a memory context has
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉 * been successfully destroyed.
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉isc_mem_stats(isc_mem_t *mctx, FILE *out);
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉 * Print memory usage statistics for 'mctx' on the stream 'out'.
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉 * If 'on' is ISC_TRUE, 'mctx' will check for memory leaks when
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉 * destroyed and abort the program if any are present.
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉 * Set/get the memory quota of 'mctx'. This is a hard limit
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉 * on the amount of memory that may be allocated from mctx;
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉 * if it is exceeded, allocations will fail.
82629edf81d6ce977440eb5ce3314cdeb0fa14daEvan Hunt * Get an estimate of the number of memory in use in 'mctx', in bytes.
bfab56849df65a2d4295b256808a66985cfa9d98Michael Graff * This includes quantization overhead, but does not include memory
bfab56849df65a2d4295b256808a66985cfa9d98Michael Graff * allocated from the system but not yet used.
1162a4e02a6594dbb4f57fd288a5d20ab467e4d7Mark Andrewsisc_mem_setwater(isc_mem_t *mctx, isc_mem_water_t water, void *water_arg,
bfab56849df65a2d4295b256808a66985cfa9d98Michael Graff * Set high and low water marks for this memory context.
bfab56849df65a2d4295b256808a66985cfa9d98Michael Graff * When the memory
bfab56849df65a2d4295b256808a66985cfa9d98Michael Graff * usage of 'mctx' exceeds 'hiwater', '(water)(water_arg, #ISC_MEM_HIWATER)'
bfab56849df65a2d4295b256808a66985cfa9d98Michael Graff * will be called. When the usage drops below 'lowater', 'water' will
bfab56849df65a2d4295b256808a66985cfa9d98Michael Graff * again be called, this time with #ISC_MEM_LOWATER.
bfab56849df65a2d4295b256808a66985cfa9d98Michael Graff * If 'water' is NULL then 'water_arg', 'hi_water' and 'lo_water' are
bfab56849df65a2d4295b256808a66985cfa9d98Michael Graff * ignored and the state is reset.
82629edf81d6ce977440eb5ce3314cdeb0fa14daEvan Hunt * 'water' is not NULL.
82629edf81d6ce977440eb5ce3314cdeb0fa14daEvan Hunt * hi_water >= lo_water
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * Memory pools
c674a8d5e7d202ada2bb617e5bb98b1859dc5a62Andreas Gustafssonisc_mempool_create(isc_mem_t *mctx, size_t size, isc_mempool_t **mpctxp);
5597be9bb88de138dfec9fa9176708443813925eTatuya JINMEI 神明達哉 * Create a memory pool.
2f012d936b5ccdf6520c96a4de23721dc58a2221Automatic Updater *\li mctx is a valid memory context.
8096fe1df5abfef957b934a1d1c5e97eaa246434Danny Mayer *\li size > 0
6d858e75d4f411e89485ec702ce1e118e1ead53cAndreas Gustafsson *\li mpctxp != NULL and *mpctxp == NULL
2f012d936b5ccdf6520c96a4de23721dc58a2221Automatic Updater *\li maxalloc = UINT_MAX
5597be9bb88de138dfec9fa9176708443813925eTatuya JINMEI 神明達哉 *\li freemax = 1
5597be9bb88de138dfec9fa9176708443813925eTatuya JINMEI 神明達哉 *\li fillcount = 1
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li #ISC_R_NOMEMORY -- not enough memory to create pool
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li #ISC_R_SUCCESS -- all is well.
016c0a82f1ce3fe4d362d7c9cf8de4377ffaf5a9Mark Andrews * Destroy a memory pool.
e0806ab5eda9add79044ccf17e55c49bae35d2e2Mark Andrews *\li mpctxp != NULL && *mpctxp is a valid pool.
e0806ab5eda9add79044ccf17e55c49bae35d2e2Mark Andrews *\li The pool has no un"put" allocations outstanding
c674a8d5e7d202ada2bb617e5bb98b1859dc5a62Andreas Gustafssonisc_mempool_setname(isc_mempool_t *mpctx, const char *name);
c674a8d5e7d202ada2bb617e5bb98b1859dc5a62Andreas Gustafsson * Associate a name with a memory pool. At most 15 characters may be used.
c674a8d5e7d202ada2bb617e5bb98b1859dc5a62Andreas Gustafsson *\li mpctx is a valid pool.
5597be9bb88de138dfec9fa9176708443813925eTatuya JINMEI 神明達哉 *\li name != NULL;
5597be9bb88de138dfec9fa9176708443813925eTatuya JINMEI 神明達哉isc_mempool_associatelock(isc_mempool_t *mpctx, isc_mutex_t *lock);
c674a8d5e7d202ada2bb617e5bb98b1859dc5a62Andreas Gustafsson * Associate a lock with this memory pool.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * This lock is used when getting or putting items using this memory pool,
c674a8d5e7d202ada2bb617e5bb98b1859dc5a62Andreas Gustafsson * and it is also used to set or get internal state via the isc_mempool_get*()
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * and isc_mempool_set*() set of functions.
8096fe1df5abfef957b934a1d1c5e97eaa246434Danny Mayer * Mutiple pools can each share a single lock. For instance, if "manager"
2f012d936b5ccdf6520c96a4de23721dc58a2221Automatic Updater * type object contained pools for various sizes of events, and each of
8096fe1df5abfef957b934a1d1c5e97eaa246434Danny Mayer * these pools used a common lock. Note that this lock must NEVER be used
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * by other than mempool routines once it is given to a pool, since that can
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * easily cause double locking.
c674a8d5e7d202ada2bb617e5bb98b1859dc5a62Andreas Gustafsson *\li mpctpx is a valid pool.
c674a8d5e7d202ada2bb617e5bb98b1859dc5a62Andreas Gustafsson *\li lock != NULL.
c674a8d5e7d202ada2bb617e5bb98b1859dc5a62Andreas Gustafsson *\li No previous lock is assigned to this pool.
c674a8d5e7d202ada2bb617e5bb98b1859dc5a62Andreas Gustafsson *\li The lock is initialized before calling this function via the normal
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * means of doing that.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * The following functions get/set various parameters. Note that due to
c674a8d5e7d202ada2bb617e5bb98b1859dc5a62Andreas Gustafsson * the unlocked nature of pools these are potentially random values unless
c674a8d5e7d202ada2bb617e5bb98b1859dc5a62Andreas Gustafsson * the imposed externally provided locking protocols are followed.
2f012d936b5ccdf6520c96a4de23721dc58a2221Automatic Updater * Also note that the quota limits will not always take immediate effect.
8096fe1df5abfef957b934a1d1c5e97eaa246434Danny Mayer * For instance, setting "maxalloc" to a number smaller than the currently
6d858e75d4f411e89485ec702ce1e118e1ead53cAndreas Gustafsson * allocated count is permitted. New allocations will be refused until
6d858e75d4f411e89485ec702ce1e118e1ead53cAndreas Gustafsson * the count drops below this threshold.
c674a8d5e7d202ada2bb617e5bb98b1859dc5a62Andreas Gustafsson * All functions require (in addition to other requirements):
c674a8d5e7d202ada2bb617e5bb98b1859dc5a62Andreas Gustafsson * mpctx is a valid memory pool
c674a8d5e7d202ada2bb617e5bb98b1859dc5a62Andreas Gustafsson * Returns the maximum allowed size of the free list.
8096fe1df5abfef957b934a1d1c5e97eaa246434Danny Mayerisc_mempool_setfreemax(isc_mempool_t *mpctx, unsigned int limit);
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * Sets the maximum allowed size of the free list.
c674a8d5e7d202ada2bb617e5bb98b1859dc5a62Andreas Gustafssonisc_mempool_getfreecount(isc_mempool_t *mpctx);
2f012d936b5ccdf6520c96a4de23721dc58a2221Automatic Updater * Returns current size of the free list.
c674a8d5e7d202ada2bb617e5bb98b1859dc5a62Andreas Gustafsson * Returns the maximum allowed number of allocations.
c674a8d5e7d202ada2bb617e5bb98b1859dc5a62Andreas Gustafssonisc_mempool_setmaxalloc(isc_mempool_t *mpctx, unsigned int limit);
8096fe1df5abfef957b934a1d1c5e97eaa246434Danny Mayer * Sets the maximum allowed number of allocations.
c674a8d5e7d202ada2bb617e5bb98b1859dc5a62Andreas Gustafsson * Additional requirements:
c674a8d5e7d202ada2bb617e5bb98b1859dc5a62Andreas Gustafsson *\li limit > 0
3a34b87c878990c6303358efd22265c2c5980c65Mark Andrews * Returns the number of items allocated from this pool.
0ef59d22882fc5d28f4683fdbe88aefd8eaad6f3Francis Dupont * Returns the number of items allocated as a block from the parent memory
9a7d202077fae00fbdca610d8a8d90689e30f331Mark Andrews * context when the free list is empty.
0ef59d22882fc5d28f4683fdbe88aefd8eaad6f3Francis Dupontisc_mempool_setfillcount(isc_mempool_t *mpctx, unsigned int limit);
9a7d202077fae00fbdca610d8a8d90689e30f331Mark Andrews * Sets the fillcount.
43581a71ab34a68227c4fc78b263cb7e09168f81Mark Andrews * Additional requirements:
9a7d202077fae00fbdca610d8a8d90689e30f331Mark Andrews *\li limit > 0
9a7d202077fae00fbdca610d8a8d90689e30f331Mark Andrews * Pseudo-private functions for use via macros. Do not call directly.
9a7d202077fae00fbdca610d8a8d90689e30f331Mark Andrewsisc__mem_get(isc_mem_t *, size_t _ISC_MEM_FLARG);
3a34b87c878990c6303358efd22265c2c5980c65Mark Andrewsisc__mem_put(isc_mem_t *, void *, size_t _ISC_MEM_FLARG);
65640f401a22971de16c01e9a9547d95c55ed45eDavid Lawrenceisc__mem_allocate(isc_mem_t *, size_t _ISC_MEM_FLARG);
3a34b87c878990c6303358efd22265c2c5980c65Mark Andrewsisc__mem_free(isc_mem_t *, void * _ISC_MEM_FLARG);
9a7d202077fae00fbdca610d8a8d90689e30f331Mark Andrewsisc__mem_strdup(isc_mem_t *, const char *_ISC_MEM_FLARG);
9a7d202077fae00fbdca610d8a8d90689e30f331Mark Andrewsisc__mempool_get(isc_mempool_t * _ISC_MEM_FLARG);
9a7d202077fae00fbdca610d8a8d90689e30f331Mark Andrewsisc__mempool_put(isc_mempool_t *, void * _ISC_MEM_FLARG);
e9733bc599f30033ffe7af69f5fca254fb59d46eMark Andrews#endif /* ISC_MEM_H */