vmem: add vmem_malloc_usable_size() to API
Merge pull request #70 from spawlows/vmem-add-malloc-usable-size

vmem: add vmem_malloc_usable_size() to API
vmem: fix freeing memory by iqalloct()

In case of huge pages iqalloct() calls huge_dalloc() for the pool #0
(src/jemalloc/include/jemalloc/internal/jemalloc_internal.h.in:834),
but huge_dalloc() should be called with the pool 'arena->pool'
as an argument in functions huge_ralloc(), arena_ralloc()
and iralloct_realign().

Add two functions: pool_iqalloct() and pool_idalloct() in order
to be able to pass a 'pool' argument from pool_iqalloct()
to huge_dalloc().

Ref: pmem/issues#8
Merge pull request #72 from ldorau/vmem-fix-freeing-memory-by-iqalloct

vmem: fix freeing memory by iqalloct()
vmem: do not reinitialize the pool[0]->chunks_mtx mutex

The pool[0]->chunks_mtx mutex is locked at chunk.c:178
(called from malloc_init_base_pool() at jemalloc.c:362)
before being initialized at chunk.c:415
(called from malloc_init_base_pool() at jemalloc.c:364).

Move a call to pools_shared_data_create() to pool_new()
after a call to chunk_boot() in order to fix this bug.

Ref: pmem/issues#17
blk: fix return value of BTT nsmap callback

Ref: pmem/issues#18
vmem: fix race condition between library constructors

Some applications need to create pool in constructor
called before constructor from vmem.
Merge pull request #71 from plebioda/fix-btt-nsmap-return-value

blk: fix return value of BTT nsmap callback
Merge pull request #74 from ldorau/vmem-do-not-reinitialize-pool-chunks_mtx-mutex

vmem: do not reinitialize the pool[0]->chunks_mtx mutex
Merge pull request #75 from spawlows/vmem-constructors-race

vmem: fix race condition between library constructors
vmem: enable tcache in je_pool_free
Merge pull request #76 from krzycz/vmem-pool_free_tcache

vmem: enable tcache in je_pool_free
vmem: add asserts checking binind

Add asserts checking binind when it is
a return value of small_size2bin()
(like in arena.c:1701 and 1858).
It fixes issues reported by Klocwork.
vmem: add the malloc_rwlock_t type
vmem: change type of pool->arenas_lock to malloc_rwlock_t
vmem: fix race condition in je_mallocx()

Ref: pmem/issues#15
Merge pull request #77 from ldorau/vmem-add-asserts-checking-binind

vmem: add asserts checking binind
common: fix make test in src/Makefile
util: remove invalid pool file of util_pool_create()

If someone tries to create a pool of size greater than the maximum
available space, posix_fallocate() fails but it leaves an invalid
file which should be removed.
Merge pull request #78 from ldorau/common-fix-make-test-in-src-Makefile

common: fix make test in src/Makefile