add iteration on entries with prefix
add a way to provide a custom memory allocator
fix order issue with static/__thread

GCC complains about  __thread static  and clang does not.