diff options
author | Michael Grunder <michael.grunder@gmail.com> | 2020-01-28 12:13:05 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-28 12:13:05 -0800 |
commit | 669ac9d0c843f9ccf07d4969ff6bff75fafee01f (patch) | |
tree | 6075cb357e13342f6844dc9891d6c3c38c8e6f86 /adapters | |
parent | 0501c623c91344e54cb2775a91509650960789b1 (diff) | |
download | hiredict-669ac9d0c843f9ccf07d4969ff6bff75fafee01f.tar.xz |
Safe allocation wrappers (#754)
Create allocation wrappers with a configurable OOM handler (defaults to abort()).
See #752, #747
Diffstat (limited to 'adapters')
-rw-r--r-- | adapters/ae.h | 2 | ||||
-rw-r--r-- | adapters/ivykis.h | 2 | ||||
-rw-r--r-- | adapters/libev.h | 2 | ||||
-rw-r--r-- | adapters/libevent.h | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/adapters/ae.h b/adapters/ae.h index 5c551c2..0393992 100644 --- a/adapters/ae.h +++ b/adapters/ae.h @@ -108,7 +108,7 @@ static int redisAeAttach(aeEventLoop *loop, redisAsyncContext *ac) { return REDIS_ERR; /* Create container for context and r/w events */ - e = (redisAeEvents*)malloc(sizeof(*e)); + e = (redisAeEvents*)hi_malloc(sizeof(*e)); e->context = ac; e->loop = loop; e->fd = c->fd; diff --git a/adapters/ivykis.h b/adapters/ivykis.h index 6a12a86..75616ee 100644 --- a/adapters/ivykis.h +++ b/adapters/ivykis.h @@ -55,7 +55,7 @@ static int redisIvykisAttach(redisAsyncContext *ac) { return REDIS_ERR; /* Create container for context and r/w events */ - e = (redisIvykisEvents*)malloc(sizeof(*e)); + e = (redisIvykisEvents*)hi_malloc(sizeof(*e)); e->context = ac; /* Register functions to start/stop listening for events */ diff --git a/adapters/libev.h b/adapters/libev.h index 2bf8d52..abad436 100644 --- a/adapters/libev.h +++ b/adapters/libev.h @@ -119,7 +119,7 @@ static int redisLibevAttach(EV_P_ redisAsyncContext *ac) { return REDIS_ERR; /* Create container for context and r/w events */ - e = (redisLibevEvents*)malloc(sizeof(*e)); + e = (redisLibevEvents*)hi_malloc(sizeof(*e)); e->context = ac; #if EV_MULTIPLICITY e->loop = loop; diff --git a/adapters/libevent.h b/adapters/libevent.h index a495277..0674ca6 100644 --- a/adapters/libevent.h +++ b/adapters/libevent.h @@ -152,7 +152,7 @@ static int redisLibeventAttach(redisAsyncContext *ac, struct event_base *base) { return REDIS_ERR; /* Create container for context and r/w events */ - e = (redisLibeventEvents*)calloc(1, sizeof(*e)); + e = (redisLibeventEvents*)hi_calloc(1, sizeof(*e)); e->context = ac; /* Register functions to start/stop listening for events */ |