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] NULL as a caml value
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jacques Garrigue <garrigue@k...>
Subject: Re: [Caml-list] NULL as a caml value
From: Christopher Quinn <>

> > Yes, NULL is valid, as are all word-aligned addresses outside of the
> > Caml heap.
> Does it even need to be word aligned?
> If Is_long() tests positive the 'pointer' is also ignored.
> I hope I have not erred!?

Sure, then this is only an integer, and the GC does not follow integers.
Someone even suggested that you can avoid the strange scenario I
described in my previous mail by "marking" pointers, that is or-ing
them with 1. If they are word aligned, then you can easily recover the

Otherwise, looking at the runtime's source, I see nothing that would
prevent from using any (even non-aligned) pointer outside of the caml
heaps to be cast to a value, but the manual does not allow it
explicitly, so this may mean that such non-aligned even values could
be used for something else. (Actually they are already used for

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