Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007203OCamlruntime system and C interfacepublic2016-03-31 15:092017-09-24 17:33
Reporterbraibant 
Assigned Togasche 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target Version4.03.1+devFixed in Version4.04.0 +dev / +beta1 / +beta2 
Summary0007203: Allocating double arrays from C in 32 bits
DescriptionReading section 19.4.4 Allocating blocks of the manual, there is apparently no function to allocate an array of floating point numbers of size n.

To implement that, users must check the word-size, and perform the right caml_small(n, Double_array_tag) invocation, where n depends on the word-size and the number of values in the array.

Would it be possible to add a convenience function in byterun/alloc.c?
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0015678)
doligez (administrator)
2016-04-05 16:28

caml_make_float_vect does what you need, but beware: if the argument is too large, it will raise an OCaml exception.
(0015680)
sliquister (reporter)
2016-04-05 17:24

caml_make_float_vect is not exposed, but it shows how to do the allocation:

caml_alloc(n * Double_wosize, Double_array_tag)
(0015997)
gasche (administrator)
2016-06-26 04:16

Fixed in trunk by merging GPR#534 -- a60ce5a6379d20ec0c5391947378f4ca404f65bd .

- Issue History
Date Modified Username Field Change
2016-03-31 15:09 braibant New Issue
2016-04-05 16:28 doligez Note Added: 0015678
2016-04-05 16:28 doligez Status new => feedback
2016-04-05 16:28 doligez Target Version => 4.03.1+dev
2016-04-05 17:24 sliquister Note Added: 0015680
2016-06-26 04:16 gasche Note Added: 0015997
2016-06-26 04:16 gasche Status feedback => resolved
2016-06-26 04:16 gasche Fixed in Version => 4.04.0 +dev / +beta1 / +beta2
2016-06-26 04:16 gasche Resolution open => fixed
2016-06-26 04:16 gasche Assigned To => gasche
2017-02-23 16:43 doligez Category OCaml runtime system => runtime system
2017-03-03 17:45 doligez Category runtime system => runtime system and C interface
2017-09-24 17:33 xleroy Status resolved => closed


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker