From: Chris Quinn <cq@htec.demon.co.uk>
To: Miles Egan <miles@caddr.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] hash_variant anomalies
Date: Tue, 03 Jul 2001 03:18:42 +0100 [thread overview]
Message-ID: <3B412B82.8243DA9@htec.demon.co.uk> (raw)
In-Reply-To: <20010702180232.A51837@caddr.com>
The Caml runtime makes a basic distinction between memory pointers and everything else - pointers are mod 2 while everything else is shifted along 1 bit and has the lsb set to 1. This allows for operation of the garbage collector. Integers are in the 'everything else' camp so 0 maps to 1, 1 to 3 ...etc.
The macros Val_int(x) and Int_val(v) allow for conversion to and from caml integer values and appropriate use of these will correct the apparent anomaly.
--
Chris Quinn
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
next prev parent reply other threads:[~2001-07-03 2:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-07-03 1:02 Miles Egan
2001-07-03 2:18 ` Chris Quinn [this message]
2001-07-03 7:42 ` Xavier Leroy
2001-07-03 15:15 ` Miles Egan
2001-07-04 0:19 ` Jacques Garrigue
2001-07-05 5:58 ` Miles Egan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3B412B82.8243DA9@htec.demon.co.uk \
--to=cq@htec.demon.co.uk \
--cc=caml-list@inria.fr \
--cc=miles@caddr.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox