+3406. [bug] mem.c: Fix compilation errors when building with
+ ISC_MEM_TRACKLINES or ISC_MEMPOOL_NAMES disabled.
+ Also, ISC_MEM_DEBUG is no longer optional. [RT #31559]
+
3405. [bug] Handle time going backwards in acache. [RT #31253]
3404. [bug] dnssec-signzone: When re-signing a zone, remove
typedef void * (*isc_memalloc_t)(void *, size_t);
typedef void (*isc_memfree_t)(void *, void *);
-/*%
- * Define ISC_MEM_DEBUG=1 to make all functions that free memory
- * set the pointer being freed to NULL after being freed.
- * This is the default; set ISC_MEM_DEBUG=0 to disable it.
- */
-#ifndef ISC_MEM_DEBUG
-#define ISC_MEM_DEBUG 1
-#endif
-
/*%
* Define ISC_MEM_TRACKLINES=1 to turn on detailed tracing of memory
* allocation and freeing by file and line number.
#define ISCAPI_MPOOL_VALID(mp) ((mp) != NULL && \
(mp)->magic == ISCAPI_MPOOL_MAGIC)
-#if ISC_MEM_DEBUG
#define isc_mem_put(c, p, s) \
do { \
ISCMEMFUNC(put)((c), (p), (s) _ISC_MEM_FILELINE); \
ISCMEMPOOLFUNC(put)((c), (p) _ISC_MEM_FILELINE); \
(p) = NULL; \
} while (0)
-#else
-#define isc_mem_put(c, p, s) ISCMEMFUNC(put)((c), (p), (s) _ISC_MEM_FILELINE)
-#define isc_mem_putanddetach(c, p, s) \
- ISCMEMFUNC(putanddetach)((c), (p), (s) _ISC_MEM_FILELINE)
-#define isc_mem_free(c, p) ISCMEMFUNC(free)((c), (p) _ISC_MEM_FILELINE)
-#define isc_mempool_put(c, p) ISCMEMPOOLFUNC(put)((c), (p) _ISC_MEM_FILELINE)
-#endif
/*@{*/
isc_result_t
#define isc_mem_isovermem isc__mem_isovermem
#define isc_mem_setname isc__mem_setname
#define isc_mem_setwater isc__mem_setwater
+#define isc_mem_printactive isc__mem_printactive
#define isc_mem_printallactive isc__mem_printallactive
#define isc_mem_waterack isc__mem_waterack
#define isc_mempool_create isc__mempool_create
#if ! ISC_MEM_TRACKLINES
#define ADD_TRACE(a, b, c, d, e)
#define DELETE_TRACE(a, b, c, d, e)
+#define ISC_MEMFUNC_SCOPE
#else
#define ADD_TRACE(a, b, c, d, e) \
do { \
ISC_MEMFUNC_SCOPE unsigned int
isc__mem_references(isc_mem_t *ctx0);
#endif
+#endif /* ISC_MEM_TRACKLINES */
static struct isc__memmethods {
isc_memmethods_t methods;
#endif
};
+#if ISC_MEM_TRACKLINES
/*!
* mctx must be locked.
*/
}
while (pool != NULL) {
fprintf(out, "%15s %10lu %10u %10u %10u %10u %10u %10u %s\n",
- pool->name, (unsigned long) pool->size, pool->maxalloc,
+#if ISC_MEMPOOL_NAMES
+ pool->name,
+#else
+ "(not tracked)",
+#endif
+ (unsigned long) pool->size, pool->maxalloc,
pool->allocated, pool->freecount, pool->freemax,
pool->fillcount, pool->gets,
(pool->lock == NULL ? "N" : "Y"));
#ifdef BIND9
ISC_MEMFUNC_SCOPE void
isc__mem_printactive(isc_mem_t *ctx0, FILE *file) {
+#if ISC_MEM_TRACKLINES
isc__mem_t *ctx = (isc__mem_t *)ctx0;
REQUIRE(VALID_CONTEXT(ctx));
REQUIRE(file != NULL);
-#if !ISC_MEM_TRACKLINES
- UNUSED(ctx);
- UNUSED(file);
-#else
print_active(ctx, file);
+#else
+ UNUSED(ctx0);
+ UNUSED(file);
#endif
}
ISC_MEMFUNC_SCOPE void
isc__mem_checkdestroyed(FILE *file) {
+#if !ISC_MEM_TRACKLINES
+ UNUSED(file);
+#endif
RUNTIME_CHECK(isc_once_do(&once, initialize_action) == ISC_R_SUCCESS);