+static void *cds_lfht_malloc(void *state __attribute__((unused)),
+ size_t size)
+{
+ return malloc(size);
+}
+
+static void *cds_lfht_calloc(void *state __attribute__((unused)),
+ size_t nmemb, size_t size)
+{
+ return calloc(nmemb, size);
+}
+
+static void *cds_lfht_realloc(void *state __attribute__((unused)),
+ void *ptr, size_t size)
+{
+ return realloc(ptr, size);
+}
+
+static void *cds_lfht_aligned_alloc(void *state __attribute__((unused)),
+ size_t alignment, size_t size)
+{
+ void *ptr;
+
+ if (posix_memalign(&ptr, alignment, size))
+ return NULL;
+ return ptr;
+}
+
+static void cds_lfht_free(void *state __attribute__((unused)), void *ptr)
+{
+ free(ptr);
+}
+
+
+/* Default memory allocator */
+static struct cds_lfht_alloc cds_lfht_default_alloc = {
+ .malloc = cds_lfht_malloc,
+ .calloc = cds_lfht_calloc,
+ .realloc = cds_lfht_realloc,
+ .aligned_alloc = cds_lfht_aligned_alloc,
+ .free = cds_lfht_free,
+ .state = NULL,
+};
+