Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: "David McClain" <dmcclain@azstarnet.com>
To: "Liste CAML" <caml-list@inria.fr>
Subject: Array Size Limitations Overcome!
Date: Sat, 30 Jan 1999 22:59:55 -0700	[thread overview]
Message-ID: <000f01be4cde$ee8f1e00$210148bf@dylan> (raw)

I have just finished developing a layer called "General_Array" on top of =
the "Array" library that permits unlimited sized arrays (up to 2^30 =
elements). I do it by noting that Array.unsafe_get and Array.unsafe_set =
cannot distingish an actual heap object from a user allocated pointer to =
doubles. By puling some stunts in C I can make OCAML deal with this =
"arena" in a uniform manner between arrays of floats and my own large =
arrays. Hence the same code writtin with the Array.unsafe_get/set works =
with either one, and I simply build my own arrays when the size would =
exceed the limits imposed by OCAML.

Note that the "alloc_final" function allows me to allocate my own large =
structures, and even though they appear as only a single heap word to =
OCAML, I can sensitize OCAML to my large allocations and force a more =
frequent GC cycle to help keep these foreign objects from overwhelming =
the paging system.

I will clean up the code and post it on my Web site shortly. I must say, =
that this was what I consider a major architectural change to the =
underpinnings of my OCAML image processing library. And yet, in spite of =
this major shift, the OCAML code worked perfectly well. I have never =
seen anything like it!  I did have one bug in my "C" code (a simple =
3-letter typo), but the OCAML stuff was pristine!


David McClain
Sr. Scientist
Raytheon Missile Systems Co.
Tucson, AZ
http://www.azstarnet.com/~dmcclain/homepage.htm




                 reply	other threads:[~1999-02-03 10:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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='000f01be4cde$ee8f1e00$210148bf@dylan' \
    --to=dmcclain@azstarnet.com \
    --cc=caml-list@inria.fr \
    /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