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

Gc.finalise and lazy values #7355

Closed
vicuna opened this issue Sep 14, 2016 · 1 comment
Closed

Gc.finalise and lazy values #7355

vicuna opened this issue Sep 14, 2016 · 1 comment

Comments

@vicuna
Copy link

@vicuna vicuna commented Sep 14, 2016

Original bug ID: 7355
Reporter: @yallop
Status: closed (set by @damiendoligez on 2016-09-28T11:46:40Z)
Resolution: fixed
Priority: normal
Severity: minor
Fixed in version: 4.04.0 +dev / +beta1 / +beta2
Category: documentation
Monitored by: braibant @dbuenzli

Bug description

The Gc module documentation says

Note that values of types [float] and ['a lazy] (for any ['a]) are
sometimes allocated and sometimes not, so finalising them is unsafe,
and [finalise] will also raise [Invalid_argument] for them.

https://github.com/ocaml/ocaml/blob/5c4c41ba/stdlib/gc.mli#L296-L298

However, passing a lazy value to Gc.finalise does not always raise an exception:

Gc.finalise ignore (lazy ignore);;

  • : unit = ()

[There's also a second small bug above: the documentation has "'a lazy" where it should have "'a Lazy.t"]

@vicuna
Copy link
Author

@vicuna vicuna commented Sep 28, 2016

Comment author: @damiendoligez

Fixed in 4.04 (commit 7cc1888).

Thanks for the report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.