Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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 [] -

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: