Example #1
0
struct nmb *nmb_new() {
	struct nmb *nmb = xmalloc(sizeof(*nmb));

	nmb->mpool = mempool_new();
	nmb->pma = pma_new(64);
	nmb->count = 0;
	nmb->memory_used = 0;

	return nmb;
}
Example #2
0
struct nmb *nmb_new(struct env *e) {
	struct nmb *nmb = xmalloc(sizeof(*nmb));

	nmb->mpool = mempool_new();
	nmb->pma = pma_new(64);
	nmb->count = 0;
	nmb->e  = e;

	return nmb;
}
Example #3
0
struct nmb *nmb_new(struct tree_options *opts)
{
	struct nmb *nmb = xmalloc(sizeof(*nmb));

	nmb->mpool = mempool_new();
	nmb->pma = pma_new(64);
	nmb->opts = opts;
	nmb->count = 0;

	ness_mutex_init(&nmb->mtx);
	ness_rwlock_init(&nmb->rwlock, &nmb->mtx);

	return nmb;
}