Ensure oom_fn callback executed on out-of-memory in calloc
authorIvan Maidanski <ivmai@mail.ru>
Fri, 18 Nov 2016 14:16:32 +0000 (17:16 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 18 Nov 2016 14:16:32 +0000 (17:16 +0300)
commit40dbd69a03753a4f2b1d8893833ebaf9a7e04f9a
treef514e8ae4c38569347206e099aa30579a0d8d865
parentc5d4ef9c1bc7ebca7e710bd96d78d28fb5fe1449
Ensure oom_fn callback executed on out-of-memory in calloc
(fix commits e10c1eb, 4e1a6f9)

* malloc.c [REDIRECT_MALLOC && !REDIRECT_MALLOC_IN_HEADER] (calloc):
Call oom_fn(SIZE_MAX) (instead of returning NULL) if n*lb overflows.
* typd_mlc.c (GC_calloc_explicitly_typed): Likewise.
* typd_mlc.c (GC_calloc_explicitly_typed): If register_disappearing_link
failed due to lack of memory then call oom_fn(lb) instead of
GC_malloc(lb); update comment.
malloc.c
typd_mlc.c