Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007446OCamlstandard librarypublic2017-01-01 20:272017-10-11 12:34
Reportermarkghayden 
Assigned To 
PrioritynormalSeveritytweakReproducibilityalways
StatusacknowledgedResolutionopen 
PlatformOSOS Version
Product Version4.04.0 
Target Version4.07.0+devFixed in Version 
Summary0007446: Unix.gettimeofday allocates memory
DescriptionUnix.gettimeofday allocates a floating point value instead of returning an unboxed float similar to Sys.time.

Unix.gettimeofday is not really in the standard library, but is included as part of the Ocaml distribution.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0017058)
gasche (developer)
2017-01-01 20:32

This issue sounds easier to fix than the other your reported so far. Would you be interested in submitting a patch to fix it, preferably as a Github pull request?

The patch that made Sys.time unboxed, contributed by Fran├žois Bobot, could serve as useful inspiration:

  https://github.com/ocaml/ocaml/commit/3c76d0678db96439bfc830b3d65d6d5b4ba6e873 [^]
(0017059)
dra (developer)
2017-01-01 21:45

Full discussion (with links to previous GPRs) for that commit at https://github.com/ocaml/ocaml/pull/281. [^]

If this is done, then there are other functions (Unix.time, for starters) which should also receive the same treatment (also remember that every change made in unix must be made in win32unix, too - but in this case the CI will catch it, as unix.mli is shared).

However, there is a potentially important difference - none of these functions is presently declared external, and it may be important to consider if we want to change that.
(0017060)
gasche (developer)
2017-01-01 21:59

I don't think that we would want to declare `external` a function that was not external before (if only because that might break compatibility, although I don't think that people would rely on Unix's signature in practice). I would naively assume that cross-compiling information would be enough for callers to be unboxed as well, but maybe I am wrong?

- Issue History
Date Modified Username Field Change
2017-01-01 20:27 markghayden New Issue
2017-01-01 20:32 gasche Note Added: 0017058
2017-01-01 20:32 gasche Status new => acknowledged
2017-01-01 21:45 dra Note Added: 0017059
2017-01-01 21:59 gasche Note Added: 0017060
2017-02-19 18:10 xleroy Severity minor => tweak
2017-02-19 18:10 xleroy Target Version => 4.06.0+dev
2017-02-23 16:43 doligez Category OCaml standard library => standard library
2017-10-11 12:34 frisch Target Version 4.06.0+dev => 4.07.0+dev


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker