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

Add a [CAMLdrop] macro which is the dual of [CAMLparam0] #142

Closed
wants to merge 1 commit into from

Conversation

Projects
None yet
2 participants
@braibant
Copy link
Contributor

commented Feb 6, 2015

When writing C stubs, it is currently not possible to reset the value
of [caml_local_roots] to the [caml__frame] value without terminating
the execution of the function (e.g. using [CAMLreturn0]). The
workaround is to use explicitly the line

caml_local_roots = caml__frame;

in the C stubs.

The proposed macro [CAMLdrop] solve the issue of having to use these
variables explicitly.

Thomas Braibant
Add a [CAMLdrop] macro which is the dual of [CAMLparam0]
When writing C stubs, it is currently not possible to reset the value
of [caml_local_roots] to the [caml__frame] value without terminating
the execution of the function (e.g. using [CAMLreturn0]). The
workaround is to use explicitly the line

```
caml_local_roots = caml__frame;
```

in the C stubs.

The proposed macro [CAMLdrop] solve the issue of having to use these
variables explicitly.
@damiendoligez

This comment has been minimized.

Copy link
Member

commented Feb 6, 2015

Good idea. I've applied the patch with a few changes (commit 15814 in trunk).

In fact, this is an excellent idea because it will (at last) allow us to really deprecate Begin_roots/End_roots.

stedolan added a commit to stedolan/ocaml that referenced this pull request Aug 3, 2017

Remove need for explicit indices in domain_state.tbl (ocaml#142)
Remove need for explicit indices in domain_state.tbl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.