]> granicus.if.org Git - gc/commit
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>
Sun, 27 Nov 2016 12:18:31 +0000 (15:18 +0300)
commit614cbed5a4731ece610eaa01d033f5bf6a9b1ba5
tree3e9afc77f859745be278e1f43554a253ec161254
parent3faa0226d1ba43182843d15232f93a729eaed35e
Ensure oom_fn callback executed on out-of-memory in calloc
(Cherry-pick commit 80f428f from 'release-7_6' branch.)

* malloc.c [REDIRECT_MALLOC] (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