summaryrefslogtreecommitdiff
path: root/alloc.h
diff options
context:
space:
mode:
Diffstat (limited to 'alloc.h')
-rw-r--r--alloc.h28
1 files changed, 14 insertions, 14 deletions
diff --git a/alloc.h b/alloc.h
index 5d0b7cf..e24ae5f 100644
--- a/alloc.h
+++ b/alloc.h
@@ -9,8 +9,8 @@
*
*/
-#ifndef HIREDIS_ALLOC_H
-#define HIREDIS_ALLOC_H
+#ifndef HIREDICT_ALLOC_H
+#define HIREDICT_ALLOC_H
#include <stddef.h> /* for size_t */
#include <stdint.h>
@@ -20,24 +20,24 @@ extern "C" {
#endif
/* Structure pointing to our actually configured allocators */
-typedef struct hiredisAllocFuncs {
+typedef struct hiredictAllocFuncs {
void *(*mallocFn)(size_t);
void *(*callocFn)(size_t,size_t);
void *(*reallocFn)(void*,size_t);
char *(*strdupFn)(const char*);
void (*freeFn)(void*);
-} hiredisAllocFuncs;
+} hiredictAllocFuncs;
-hiredisAllocFuncs hiredisSetAllocators(hiredisAllocFuncs *ha);
-void hiredisResetAllocators(void);
+hiredictAllocFuncs hiredictSetAllocators(hiredictAllocFuncs *ha);
+void hiredictResetAllocators(void);
#ifndef _WIN32
-/* Hiredis' configured allocator function pointer struct */
-extern hiredisAllocFuncs hiredisAllocFns;
+/* Hiredict' configured allocator function pointer struct */
+extern hiredictAllocFuncs hiredictAllocFns;
static inline void *hi_malloc(size_t size) {
- return hiredisAllocFns.mallocFn(size);
+ return hiredictAllocFns.mallocFn(size);
}
static inline void *hi_calloc(size_t nmemb, size_t size) {
@@ -45,19 +45,19 @@ static inline void *hi_calloc(size_t nmemb, size_t size) {
if (SIZE_MAX / size < nmemb)
return NULL;
- return hiredisAllocFns.callocFn(nmemb, size);
+ return hiredictAllocFns.callocFn(nmemb, size);
}
static inline void *hi_realloc(void *ptr, size_t size) {
- return hiredisAllocFns.reallocFn(ptr, size);
+ return hiredictAllocFns.reallocFn(ptr, size);
}
static inline char *hi_strdup(const char *str) {
- return hiredisAllocFns.strdupFn(str);
+ return hiredictAllocFns.strdupFn(str);
}
static inline void hi_free(void *ptr) {
- hiredisAllocFns.freeFn(ptr);
+ hiredictAllocFns.freeFn(ptr);
}
#else
@@ -74,4 +74,4 @@ void hi_free(void *ptr);
}
#endif
-#endif /* HIREDIS_ALLOC_H */
+#endif /* HIREDICT_ALLOC_H */