Add type-checked versions of allocation and deallocations functions
[lttng-tools.git] / src / common / hashtable / hashtable.cpp
index 5ae7f26e0e0fbde4aa168dbf1a229ec6140f8b9b..1b40f91f125fa97ef46d409476148d1ef29585dd 100644 (file)
 #include <urcu.h>
 #include <urcu/compiler.h>
 
-#include <common/common.h>
-#include <common/defaults.h>
+#include <common/common.hpp>
+#include <common/defaults.hpp>
 
-#include "hashtable.h"
-#include "utils.h"
+#include "hashtable.hpp"
+#include "utils.hpp"
 
 /* seed_lock protects both seed_init and lttng_ht_seed. */
 static pthread_mutex_t seed_lock = PTHREAD_MUTEX_INITIALIZER;
 static bool seed_init;
-unsigned long lttng_ht_seed;
 
 static unsigned long min_hash_alloc_size = 1;
 static unsigned long max_hash_buckets_size = 0;
@@ -111,7 +110,7 @@ struct lttng_ht *lttng_ht_new(unsigned long size, lttng_ht_type type)
        }
        pthread_mutex_unlock(&seed_lock);
 
-       ht = (lttng_ht *) zmalloc(sizeof(*ht));
+       ht = zmalloc<lttng_ht>();
        if (ht == NULL) {
                PERROR("zmalloc lttng_ht");
                goto error;
This page took 0.023436 seconds and 4 git commands to generate.