Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ports #1914 (is_stack macro for C-stub authors) #2085

Merged
merged 1 commit into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ocaml/runtime/array.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ CAMLprim value caml_array_blit(value a1, value ofs1, value a2, value ofs2,
return caml_floatarray_blit(a1, ofs1, a2, ofs2, n);
#endif
CAMLassert (Tag_val(a2) != Double_array_tag);
if (Is_young(a2) || caml_is_local(a2)) {
if (Is_young(a2) || caml_is_stack(a2)) {
/* Arrays of values, destination is local or in young generation.
Here too we can do a direct copy since this cannot create
old-to-young pointers, nor mess up with the incremental major GC.
Expand Down Expand Up @@ -638,7 +638,7 @@ CAMLprim value caml_array_fill(value array,
}
#endif
fp = &Field(array, ofs);
if (Is_young(array) || caml_is_local(array)) {
if (Is_young(array) || caml_is_stack(array)) {
for (; len > 0; len--, fp++) *fp = val;
} else {
int is_val_young_block = Is_block(val) && Is_young(val);
Expand Down
2 changes: 1 addition & 1 deletion ocaml/runtime/caml/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ CAMLextern caml_stat_string caml_stat_strconcat(int n, ...);
CAMLextern wchar_t* caml_stat_wcsconcat(int n, ...);
#endif

CAMLextern int caml_is_local(value);
CAMLextern int caml_is_stack(value);

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

Expand Down
4 changes: 2 additions & 2 deletions ocaml/runtime/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ CAMLexport void caml_set_fields (value obj, value v)
}
}

CAMLexport int caml_is_local (value v)
CAMLexport int caml_is_stack (value v)
{
int i;
struct caml_local_arenas* loc = Caml_state->local_arenas;
Expand All @@ -359,7 +359,7 @@ CAMLexport void caml_modify_local (value obj, intnat i, value val)
{
if (Color_hd(Hd_val(obj)) == NOT_MARKABLE) {
/* This function should not be used on external values */
CAMLassert(caml_is_local(obj));
CAMLassert(caml_is_stack(obj));
Field(obj, i) = val;
} else {
caml_modify(&Field(obj, i), val);
Expand Down
2 changes: 1 addition & 1 deletion ocaml/runtime/obj.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ CAMLprim value caml_lazy_update_to_forcing (value v)

CAMLprim value caml_obj_is_stack (value v)
{
return Val_int(caml_is_local(v));
return Val_int(caml_is_stack(v));
}

/* For mlvalues.h and camlinternalOO.ml
Expand Down
Loading