summaryrefslogtreecommitdiffstats
path: root/byterun/alloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'byterun/alloc.c')
-rw-r--r--byterun/alloc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/byterun/alloc.c b/byterun/alloc.c
index a1fd2f03e..1fc33b55a 100644
--- a/byterun/alloc.c
+++ b/byterun/alloc.c
@@ -39,11 +39,13 @@ CAMLexport value caml_alloc (mlsize_t wosize, tag_t tag)
}else if (wosize <= Max_young_wosize){
Alloc_small (result, wosize, tag);
if (tag < No_scan_tag){
- for (i = 0; i < wosize; i++) Field (result, i) = 0;
+ for (i = 0; i < wosize; i++) Field (result, i) = Val_unit;
}
}else{
result = caml_alloc_shr (wosize, tag);
- if (tag < No_scan_tag) memset (Bp_val (result), 0, Bsize_wsize (wosize));
+ if (tag < No_scan_tag){
+ for (i = 0; i < wosize; i++) Field (result, i) = Val_unit;
+ }
result = caml_check_urgent_gc (result);
}
return result;