Commit Graph

7 Commits

Author SHA1 Message Date
Michael Grunder 8e0264cfd6
Allow users to replace allocator and handle OOM everywhere. (#800)
* Adds an indirection to every allocation/deallocation to allow users to 
  plug in ones of their choosing (use custom functions, jemalloc, etc).

* Gracefully handle OOM everywhere in hiredis.  This should make it possible
  for users of the library to have more flexibility in how they handle such situations.

* Changes `redisReaderTask->elements` from an `int` to a `long long` to prevent
  a possible overflow when transferring the task elements into a `redisReply`.

* Adds a configurable `max elements` member to `redisReader` that defaults to
  2^32 - 1.  This can be set to "unlimited" by setting the value to zero.
2020-05-22 09:27:49 -07:00
Michael Grunder 669ac9d0c8
Safe allocation wrappers (#754)
Create allocation wrappers with a configurable OOM handler (defaults to abort()).

See #752, #747
2020-01-28 12:13:05 -08:00
antirez 2d66c4814e Add missing license and copyright for adapters
This is a backport of
d01aad329c
2014-04-09 17:02:42 -04:00
R. Tyler Croy 0bf4dded31 Convert the rest of the async adapters contain static functions for easier linking 2011-06-27 12:40:59 -07:00
Pieter Noordhuis 18c55a8f1e Scope event library related data and hooks to a struct 2010-12-29 15:41:03 +01:00
Pieter Noordhuis af7369a253 Use extra field for adapter-specific data
This makes sure that the "data" field on the asynchronous context can be
used for user-specific data.
2010-12-01 16:43:24 +01:00
Pieter Noordhuis 9af1574d6e Add adapter for the Redis-bundled ae event library 2010-12-01 13:47:58 +01:00