Re: [Caml-list] Physical counterpart to Pervasives.compare?

2009-08-26 Thread Damien Doligez
On 2009-08-25, at 20:03, Christophe Raffalli wrote: [...] and the minor heap is at a higher adress than the major heap, That would be very hard to guarantee, given the current OS trend toward address randomization. How much slower is the compacting major GC comparer to the standard one ?

Re: [Caml-list] Physical counterpart to Pervasives.compare?

2009-08-25 Thread Christophe Raffalli
> > But you should still do the comparison > with a unique C function written for this purpose. > If you tried to use a "convert address to int" function, > you would have a race condition between the conversion > of each address and garbage collection. Or, if all major GCs are compacting and the

Re: [Caml-list] Physical counterpart to Pervasives.compare?

2009-08-24 Thread Pascal Cuoq
Pascal Cuoq a écrit : Elnatan Reisner wrote: Is there something that can complete this analogy: (=) is to (==) as Pervasives.compare is to ___? The simple solution is to number at creation the objects that you want to physically compare, using an additional field. Since people are still pa

Re: [Caml-list] Physical counterpart to Pervasives.compare?

2009-08-24 Thread Jean-Christophe Filliâtre
Pascal Cuoq a écrit : >> Elnatan Reisner wrote: >>> Is there something that can complete this analogy: >>> (=) is to (==) as Pervasives.compare is to ___? >>> > The simple solution is to number at creation the objects that you want to > physically compare, using an additional field. You can do tha

Re: [Caml-list] Physical counterpart to Pervasives.compare?

2009-07-29 Thread Pascal Cuoq
Edgar Friendly wrote: Elnatan Reisner wrote: 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? No, but it'd be pretty trivia

Re: [Caml-list] Physical counterpart to Pervasives.compare?

2009-07-28 Thread Alain Frisch
On 7/29/2009 3:25 AM, Elnatan Reisner wrote: 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? Not really. The physical location

Re: [Caml-list] Physical counterpart to Pervasives.compare?

2009-07-28 Thread Edgar Friendly
Edgar Friendly wrote: > Elnatan Reisner wrote: >> 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

Re: [Caml-list] Physical counterpart to Pervasives.compare?

2009-07-28 Thread Edgar Friendly
Elnatan Reisner wrote: > 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? > No, but it'd be pretty trivial to implement thr

[Caml-list] Physical counterpart to Pervasives.compare?

2009-07-28 Thread Elnatan Reisner
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 (