summaryrefslogtreecommitdiff
path: root/typd_mlc.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2011-07-26 13:09:22 +0200
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 13:09:22 +0200
commitf9b1aa2161e755a5f5b772b5698aab8a63d0bef4 (patch)
tree1353072248edd6eb43149a47cc3b2a65d61fd569 /typd_mlc.c
parent2d90eba35546e0aa17a1014026ddbf4f523cad85 (diff)
gc4.11 tarball importgc4_11
Diffstat (limited to 'typd_mlc.c')
-rw-r--r--typd_mlc.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/typd_mlc.c b/typd_mlc.c
index 72fd421..7336e33 100644
--- a/typd_mlc.c
+++ b/typd_mlc.c
@@ -467,7 +467,7 @@ register complex_descriptor *d;
+ GC_descr_obj_size(d -> sd.sd_second));
default:
ABORT("Bad complex descriptor");
- /*NOTREACHED*/
+ /*NOTREACHED*/ return 0; /*NOTREACHED*/
}
}
@@ -527,8 +527,8 @@ mse * msl;
}
default:
ABORT("Bad complex descriptor");
- /*NOTREACHED*/
- }
+ /*NOTREACHED*/ return 0; /*NOTREACHED*/
+ }
}
/*ARGSUSED*/
@@ -655,6 +655,7 @@ DCL_LOCK_STATE;
if( !FASTLOCK_SUCCEEDED() || (op = *opp) == 0 ) {
FASTUNLOCK();
op = (ptr_t)GENERAL_MALLOC((word)lb, GC_explicit_kind);
+ if (0 == op) return(0);
# ifdef MERGE_SIZES
lw = GC_size_map[lb]; /* May have been uninitialized. */
# endif
@@ -665,6 +666,7 @@ DCL_LOCK_STATE;
}
} else {
op = (ptr_t)GENERAL_MALLOC((word)lb, GC_explicit_kind);
+ if (0 == op) return(0);
lw = BYTES_TO_WORDS(GC_size(op));
}
((word *)op)[lw - 1] = d;
@@ -716,6 +718,7 @@ DCL_LOCK_STATE;
if( !FASTLOCK_SUCCEEDED() || (op = *opp) == 0 ) {
FASTUNLOCK();
op = (ptr_t)GENERAL_MALLOC((word)lb, GC_array_kind);
+ if (0 == op) return(0);
# ifdef MERGE_SIZES
lw = GC_size_map[lb]; /* May have been uninitialized. */
# endif
@@ -726,6 +729,7 @@ DCL_LOCK_STATE;
}
} else {
op = (ptr_t)GENERAL_MALLOC((word)lb, GC_array_kind);
+ if (0 == op) return(0);
lw = BYTES_TO_WORDS(GC_size(op));
}
if (descr_type == LEAF) {
@@ -752,11 +756,10 @@ DCL_LOCK_STATE;
((word *)op+lw-1),
(GC_PTR) op);
if (ff != GC_finalization_failures) {
- /* We may have failed to register op due to lack of memory. */
- /* We were out of memory very recently, so we can safely */
- /* punt. */
- ((word *)op)[lw - 1] = 0;
- return(0);
+ /* Couldn't register it due to lack of memory. Punt. */
+ /* This will probably fail too, but gives the recovery code */
+ /* a chance. */
+ return(GC_malloc(n*lb));
}
}
return((GC_PTR) op);