caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* float array/record unboxing
@ 2009-05-11 17:49 Yitzhak Mandelbaum
  2009-05-11 18:49 ` [Caml-list] " Markus Mottl
  0 siblings, 1 reply; 3+ messages in thread
From: Yitzhak Mandelbaum @ 2009-05-11 17:49 UTC (permalink / raw)
  To: Caml-list List

hi,

Does anyone know whether float arrays/records are unboxed if float is  
used to instantiate a  type parameter? E.g.

module F (R:sig type t end) = struct
   type foo = { a1 : R.t; b1 : R.t; }
end

module M = F(struct type t = float end)

Is M.foo an unboxed array of floats (as per Chapter 18.3.2 in the  
manual) or not? Empirical evidence suggests that the floats *are*  
boxed. If this is the case, can anyone point me to where this feature  
is documented?

Thanks,
Yitzhak
-----------------------------
Yitzhak Mandelbaum




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] float array/record unboxing
  2009-05-11 17:49 float array/record unboxing Yitzhak Mandelbaum
@ 2009-05-11 18:49 ` Markus Mottl
  2009-05-11 20:30   ` malc
  0 siblings, 1 reply; 3+ messages in thread
From: Markus Mottl @ 2009-05-11 18:49 UTC (permalink / raw)
  To: Yitzhak Mandelbaum; +Cc: Caml-list List

On Mon, May 11, 2009 at 13:49, Yitzhak Mandelbaum
<yitzhakm@cs.princeton.edu> wrote:
> Does anyone know whether float arrays/records are unboxed if float is used
> to instantiate a  type parameter? E.g.
[snip]

Since functor applications are currently not inlined, the generated
code for the functor body has no way of seeing that its dealing with
an all-floats record.  Hence the record will contain boxed floats.

> Is M.foo an unboxed array of floats (as per Chapter 18.3.2 in the manual) or
> not? Empirical evidence suggests that the floats *are* boxed. If this is the
> case, can anyone point me to where this feature is documented?

I don't think this is documented anywhere, since this is an
implementation detail that (though unlikely) might even change in the
future.

Regards,
Markus

-- 
Markus Mottl        http://www.ocaml.info        markus.mottl@gmail.com


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] float array/record unboxing
  2009-05-11 18:49 ` [Caml-list] " Markus Mottl
@ 2009-05-11 20:30   ` malc
  0 siblings, 0 replies; 3+ messages in thread
From: malc @ 2009-05-11 20:30 UTC (permalink / raw)
  To: Markus Mottl; +Cc: Yitzhak Mandelbaum, Caml-list List

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1171 bytes --]

On Mon, 11 May 2009, Markus Mottl wrote:

> On Mon, May 11, 2009 at 13:49, Yitzhak Mandelbaum
> <yitzhakm@cs.princeton.edu> wrote:
> > Does anyone know whether float arrays/records are unboxed if float is used
> > to instantiate a  type parameter? E.g.
> [snip]
> 
> Since functor applications are currently not inlined, the generated
> code for the functor body has no way of seeing that its dealing with
> an all-floats record.  Hence the record will contain boxed floats.
> 
> > Is M.foo an unboxed array of floats (as per Chapter 18.3.2 in the manual) or
> > not? Empirical evidence suggests that the floats *are* boxed. If this is the
> > case, can anyone point me to where this feature is documented?
> 
> I don't think this is documented anywhere, since this is an
> implementation detail that (though unlikely) might even change in the
> future.

This reminded me of a question i asked, what seemed like a jiffy ago:
http://groups.google.com/group/fa.caml/browse_thread/thread/e5e0d989e53de0a1/c64a14722acb0153?hl=en

Given what have been said in that thread the detail becomes worthy of
a mention somewhere.

-- 
mailto:av1474@comtv.ru

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-05-11 20:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-11 17:49 float array/record unboxing Yitzhak Mandelbaum
2009-05-11 18:49 ` [Caml-list] " Markus Mottl
2009-05-11 20:30   ` malc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).