X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=src%2Fcommon%2Fhashtable%2Fhashtable.cpp;h=1b40f91f125fa97ef46d409476148d1ef29585dd;hb=64803277bbdbe0a943360d918298a48157d9da55;hp=7112debf28eae58a63bc6bb7d367ffac81f6a6c1;hpb=6dca8ba7dec3b31acb7b43f5e4431676acf4e664;p=lttng-tools.git diff --git a/src/common/hashtable/hashtable.cpp b/src/common/hashtable/hashtable.cpp index 7112debf2..1b40f91f1 100644 --- a/src/common/hashtable/hashtable.cpp +++ b/src/common/hashtable/hashtable.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 David Goulet + * Copyright (C) 2011 EfficiOS Inc. * * SPDX-License-Identifier: GPL-2.0-only * @@ -10,16 +10,15 @@ #include #include -#include -#include +#include +#include -#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(); if (ht == NULL) { PERROR("zmalloc lttng_ht"); goto error;