Commit Graph

8 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
Kevin
e58a9f7d52
Fix typo in dict.c. 2019-11-20 00:00:00 +08:00
charsyam
e2f6ee239c fixing typos 2015-10-28 02:19:24 +09:00
Pieter Noordhuis
c6b8bd77c0 Make dictionary functions static and include the .c file 2011-01-14 12:07:29 +01:00
Pieter Noordhuis
b758e52e44 Remove unused code/cleanup 2010-12-31 15:49:26 +01:00
Pieter Noordhuis
4e8c8e74ee Replace zmalloc with regular malloc 2010-12-31 15:49:26 +01:00
Pieter Noordhuis
5703dfc306 Import dictionary code from Redis repository (as of 2069d06a) 2010-12-31 15:49:26 +01:00