size_t debuglistcnt;
#endif
- unsigned int memalloc_failures;
ISC_LINK(isc__mem_t) link;
};
table_size = ctx->basic_table_size + TABLE_INCREMENT;
table = (ctx->memalloc)(ctx->arg,
table_size * sizeof(unsigned char *));
- if (table == NULL) {
- ctx->memalloc_failures++;
- return (false);
- }
+ RUNTIME_CHECK(table != NULL);
ctx->malloced += table_size * sizeof(unsigned char *);
if (ctx->malloced > ctx->maxmalloced)
ctx->maxmalloced = ctx->malloced;
}
tmp = (ctx->memalloc)(ctx->arg, NUM_BASIC_BLOCKS * ctx->mem_target);
- if (tmp == NULL) {
- ctx->memalloc_failures++;
- return (false);
- }
+ RUNTIME_CHECK(tmp != NULL);
ctx->total += NUM_BASIC_BLOCKS * ctx->mem_target;;
ctx->basic_table[ctx->basic_table_count] = tmp;
ctx->basic_table_count++;
* memget() was called on something beyond our upper limit.
*/
ret = (ctx->memalloc)(ctx->arg, size);
- if (ret == NULL) {
- ctx->memalloc_failures++;
- goto done;
- }
+ RUNTIME_CHECK(ret != NULL);
ctx->total += size;
ctx->inuse += size;
ctx->stats[ctx->max_size].gets++;
size += 1;
#endif
ret = (ctx->memalloc)(ctx->arg, size);
- if (ret == NULL)
- ctx->memalloc_failures++;
+ RUNTIME_CHECK(ret != NULL);
if (ISC_UNLIKELY((ctx->flags & ISC_MEMFLAG_FILL) != 0)) {
if (ISC_LIKELY(ret != NULL))
}
#endif
- ctx->memalloc_failures = 0;
-
LOCK(&contextslock);
ISC_LIST_INITANDAPPEND(contexts, ctx, link);
UNLOCK(&contextslock);