Skip to content

Commit 9c66789

Browse files
authored
Ports #1914 (is_stack macro for C-stub authors) (#2085)
ports #1914
1 parent b4dd4bf commit 9c66789

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

ocaml/runtime/array.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ CAMLprim value caml_array_blit(value a1, value ofs1, value a2, value ofs2,
404404
return caml_floatarray_blit(a1, ofs1, a2, ofs2, n);
405405
#endif
406406
CAMLassert (Tag_val(a2) != Double_array_tag);
407-
if (Is_young(a2) || caml_is_local(a2)) {
407+
if (Is_young(a2) || caml_is_stack(a2)) {
408408
/* Arrays of values, destination is local or in young generation.
409409
Here too we can do a direct copy since this cannot create
410410
old-to-young pointers, nor mess up with the incremental major GC.
@@ -638,7 +638,7 @@ CAMLprim value caml_array_fill(value array,
638638
}
639639
#endif
640640
fp = &Field(array, ofs);
641-
if (Is_young(array) || caml_is_local(array)) {
641+
if (Is_young(array) || caml_is_stack(array)) {
642642
for (; len > 0; len--, fp++) *fp = val;
643643
} else {
644644
int is_val_young_block = Is_block(val) && Is_young(val);

ocaml/runtime/caml/memory.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ CAMLextern caml_stat_string caml_stat_strconcat(int n, ...);
166166
CAMLextern wchar_t* caml_stat_wcsconcat(int n, ...);
167167
#endif
168168

169-
CAMLextern int caml_is_local(value);
169+
CAMLextern int caml_is_stack(value);
170170

171171
/* void caml_shrink_heap (char *); Only used in compact.c */
172172

ocaml/runtime/memory.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ CAMLexport void caml_set_fields (value obj, value v)
333333
}
334334
}
335335

336-
CAMLexport int caml_is_local (value v)
336+
CAMLexport int caml_is_stack (value v)
337337
{
338338
int i;
339339
struct caml_local_arenas* loc = Caml_state->local_arenas;
@@ -359,7 +359,7 @@ CAMLexport void caml_modify_local (value obj, intnat i, value val)
359359
{
360360
if (Color_hd(Hd_val(obj)) == NOT_MARKABLE) {
361361
/* This function should not be used on external values */
362-
CAMLassert(caml_is_local(obj));
362+
CAMLassert(caml_is_stack(obj));
363363
Field(obj, i) = val;
364364
} else {
365365
caml_modify(&Field(obj, i), val);

ocaml/runtime/obj.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ CAMLprim value caml_lazy_update_to_forcing (value v)
260260

261261
CAMLprim value caml_obj_is_stack (value v)
262262
{
263-
return Val_int(caml_is_local(v));
263+
return Val_int(caml_is_stack(v));
264264
}
265265

266266
/* For mlvalues.h and camlinternalOO.ml

0 commit comments

Comments
 (0)