summaryrefslogtreecommitdiff
path: root/alloc.h
diff options
context:
space:
mode:
authorAnna (navi) Figueiredo Gomes <navi@vlhl.dev>2024-03-23 01:21:46 +0100
committerAnna (navi) Figueiredo Gomes <navi@vlhl.dev>2024-03-23 01:21:46 +0100
commitbb3475e8eb379ee18f3d8f37caa8040b852a6213 (patch)
tree89975f1c23814a7ab5e16f5c7887f55f1888a27a /alloc.h
parentaee72918851db8af296e096b759dfb7aaea17968 (diff)
all: rename redis -> redict symbols and commentsmaster
Signed-off-by: Anna (navi) Figueiredo Gomes <navi@vlhl.dev>
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 */