summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2023-04-25 21:40:55 +0300
committerIvan Maidanski <ivmai@mail.ru>2023-04-28 19:49:55 +0300
commit7891261fa1ddc443b2d2971ad1e5653e8a2ffd34 (patch)
tree87191713f0fdc919b82b0ab16cf2281cd20a7167
parentc1d1915271e51bb1d725e3d1191c14e0181b1a57 (diff)
downloadbdwgc-7891261fa1ddc443b2d2971ad1e5653e8a2ffd34.tar.gz
Invoke GC_oom_fn if GC_make_array_descriptor failed because of no memory
(a cherry-pick of commit 223ce4fdf from 'master') * typd_mlc.c (GC_calloc_explicitly_typed): If descr_type is NO_MEM then return the result of GC_get_oom_fn()(lb) instead of NULL.
-rw-r--r--typd_mlc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/typd_mlc.c b/typd_mlc.c
index 1ec4dcf4..4fbcd276 100644
--- a/typd_mlc.c
+++ b/typd_mlc.c
@@ -691,7 +691,8 @@ GC_API GC_ATTR_MALLOC void * GC_CALL GC_calloc_explicitly_typed(size_t n,
&complex_descr, &leaf);
lb *= n;
switch(descr_type) {
- case NO_MEM: return(0);
+ case NO_MEM:
+ return (*GC_get_oom_fn())(lb);
case SIMPLE:
return GC_malloc_explicitly_typed(lb, simple_descr);
case LEAF: