Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] GC and caml_oldify_local_roots taking too much time
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jere Sanisalo <xm@x...>
Subject: Re: [Caml-list] Calback
> > I'm afraid this will break on plaforms where `sizeof (int) != sizeof 
> > (long)'.
>If it is still int, I could do a test in the C code and go through a C 
>array if (sizeof(int) != sizeof(void*))

Why not do something along the lines of:
#define Meta_Assert(expr) typedef int __META_ASSERT__[(expr)? 1 : -1];

and then simply asserting it runtime? Like:
  Meta_Assert( sizeof(int) = sizeof(void*) );
Of course if you DO want it to work with different sizes, a different
approach is wanted. But mostly thses kind of things are nice, as they check
at compile time that certain truths about the runtime are true.

-- 
Jere Sanisalo [xm@xmunkki.org] - http://www.xmunkki.org/

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners