aboutsummaryrefslogtreecommitdiffstats
path: root/Hashtable.c
diff options
context:
space:
mode:
authorDaniel Lange <DLange@git.local>2016-04-11 13:01:07 +0200
committerDaniel Lange <DLange@git.local>2016-04-11 13:01:07 +0200
commitff9409b1737627857eb47f64f536a3f66b6a09a4 (patch)
tree61b631ba551e68a4f656b8b76ff7bd0d9955fc64 /Hashtable.c
parentf75ab6d2c11e8a8e18191b087564aedebbeb96c5 (diff)
downloaddebian_htop-ff9409b1737627857eb47f64f536a3f66b6a09a4.tar.gz
debian_htop-ff9409b1737627857eb47f64f536a3f66b6a09a4.tar.bz2
debian_htop-ff9409b1737627857eb47f64f536a3f66b6a09a4.zip
Imported Upstream version 2.0.0upstream/2.0.0
Diffstat (limited to 'Hashtable.c')
-rw-r--r--Hashtable.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/Hashtable.c b/Hashtable.c
index 0f61519..b3eac8d 100644
--- a/Hashtable.c
+++ b/Hashtable.c
@@ -6,6 +6,7 @@ in the source distribution for its full text.
*/
#include "Hashtable.h"
+#include "XAlloc.h"
#include <stdlib.h>
#include <assert.h>
@@ -63,7 +64,7 @@ int Hashtable_count(Hashtable* this) {
static HashtableItem* HashtableItem_new(unsigned int key, void* value) {
HashtableItem* this;
- this = (HashtableItem*) malloc(sizeof(HashtableItem));
+ this = xMalloc(sizeof(HashtableItem));
this->key = key;
this->value = value;
this->next = NULL;
@@ -73,10 +74,10 @@ static HashtableItem* HashtableItem_new(unsigned int key, void* value) {
Hashtable* Hashtable_new(int size, bool owner) {
Hashtable* this;
- this = (Hashtable*) malloc(sizeof(Hashtable));
+ this = xMalloc(sizeof(Hashtable));
this->items = 0;
this->size = size;
- this->buckets = (HashtableItem**) calloc(size, sizeof(HashtableItem*));
+ this->buckets = (HashtableItem**) xCalloc(size, sizeof(HashtableItem*));
this->owner = owner;
assert(Hashtable_isConsistent(this));
return this;

© 2014-2024 Faster IT GmbH | imprint | privacy policy