nvml-sys 0.0.6

A low-level FFI wrapper around the Persistent Memory Development Kit, PMDK (formerly NVML) and its libraries, including libpmem, libpmemobj and others. Currently tracks master after version 1.3.1.
#include "pool.h"

static char buff_alloc[4*1024];
static char *buff_ptr = buff_alloc;

void *
malloc_test(size_t size) {
	custom_allocs++;
	void *ret = buff_ptr;
	buff_ptr = buff_ptr + size;
	return ret;
}

void
free_test(void *ptr) {
	custom_allocs--;
	if(custom_allocs == 0) {
		buff_ptr = buff_alloc;
	}
}

int
main(void)
{
	je_pool_set_alloc_funcs(malloc_test, free_test);

	return test_not_init(POOL_TEST_CASES);
}