return ((size + ALIGNMENT_SIZE - 1) & (~(ALIGNMENT_SIZE - 1)));
}
-static inline bool
+static inline void
more_basic_blocks(isc__mem_t *ctx) {
void *tmp;
unsigned char *curr, *next;
unsigned int table_size;
int i;
+ if (ctx->basic_blocks != NULL) {
+ /* Nothing to do. */
+ return;
+ }
+
/* Require: we hold the context lock. */
INSIST(ctx->basic_table_count <= ctx->basic_table_size);
if (last > ctx->highest)
ctx->highest = last;
ctx->basic_blocks = tmp;
-
- return (true);
}
static inline bool
* Try to get more fragments by chopping up a basic block.
*/
+ more_basic_blocks(ctx);
if (ctx->basic_blocks == NULL) {
- if (!more_basic_blocks(ctx)) {
- /*
- * We can't get more memory from the OS, or we've
- * hit the quota for this context.
- */
- /*
- * XXXRTH "At quota" notification here.
- */
- return (false);
- }
+ /*
+ * We can't get more memory from the OS, or we've
+ * hit the quota for this context.
+ */
+ /*
+ * XXXRTH "At quota" notification here.
+ */
+ return (false);
}
total_size = ctx->mem_target;