Esempio n. 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;
}
Esempio n. 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;
}
Esempio n. 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;
}