caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Re: Physical counterpart to Pervasives.compare?
       [not found] <20090826100004.0169CBC58@yquem.inria.fr>
@ 2009-08-26 10:14 ` Pascal Cuoq
  0 siblings, 0 replies; 2+ messages in thread
From: Pascal Cuoq @ 2009-08-26 10:14 UTC (permalink / raw)
  To: caml-list

Christophe Raffalli <christophe.raffalli@univ-savoie.fr> wrote:
> Or, if all major GCs are compacting and the minor heap is at
> a higher adress than the major heap, then OCaml's could also
> preserve the adress order between GC ...

I do not think that the current minor GC algorithm does
any effort to copy the live blocks from the minor heap in order
(i.e. to copy first the blocks with the lower addresses).
It copies them as it finds them, recursively. Two blocks from
the minor heap may still see the order in which they are
in memory change when they are both copied
to the major heap.
For this reason, I do not think that the above trick would work.

Pascal


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

* Physical counterpart to Pervasives.compare?
@ 2009-07-29  1:25 Elnatan Reisner
  0 siblings, 0 replies; 2+ messages in thread
From: Elnatan Reisner @ 2009-07-29  1:25 UTC (permalink / raw)
  To: caml-list

Is there something that can complete this analogy:
(=) is to (==) as Pervasives.compare is to ___?

That is, is there a polymorphic total ordering with respect to *physical*
entities, rather than to their structure?

I'm afraid of getting into trouble with Obj.magic, but what would this do:
let f (x:'a) (y:'a) = compare (Obj.magic x) (Obj.magic y)
? Or would annotations make any difference:
let f (x:'a) (y:'a) = compare (Obj.magic x : int) (Obj.magic y : int)

-Elnatan


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

end of thread, other threads:[~2009-08-26 10:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20090826100004.0169CBC58@yquem.inria.fr>
2009-08-26 10:14 ` Physical counterpart to Pervasives.compare? Pascal Cuoq
2009-07-29  1:25 Elnatan Reisner

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).