<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2003/07/3444f9db4683b79f42ccc688703d54b7"
  from="John Max Skaller &lt;skaller@o...&gt;"
  author="John Max Skaller"
  date="2003-07-03T10:35:06"
  subject="Re: [Caml-list] alloc_final and local value variables"
  prev="2003/07/a775e3565682015431fdeb349bd82591"
  next="2003/07/e6b497b6561e6b659094f56674cbd2d4"
  prev-in-thread="2003/07/bbf60d825fc8b08ddc054bb6ccbbeb48"
  prev-thread="2003/07/344b723b56e3139d35f2009777e68d31"
  next-thread="2003/07/d3684049ef97610c271443c5f8c1c003"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] alloc_final and local value variables">
<msg 
  url="2003/07/bbf60d825fc8b08ddc054bb6ccbbeb48"
  from="Neil Conway &lt;neilc@s...&gt;"
  author="Neil Conway"
  date="2003-07-02T01:20:46"
  subject="[Caml-list] alloc_final and local value variables">
<msg 
  url="2003/07/3444f9db4683b79f42ccc688703d54b7"
  from="John Max Skaller &lt;skaller@o...&gt;"
  author="John Max Skaller"
  date="2003-07-03T10:35:06"
  subject="Re: [Caml-list] alloc_final and local value variables">
</msg>
</msg>
</thread>

<contents>
Neil Conway wrote:

&gt; In Chapter 12 of the O'Reilly book on Ocaml, section "Creating and modifying
&gt; Objective CAML values from C", this example code is given for wrapping a
&gt; heap-allocated chunk of memory in an Ocaml value:
 
&gt; This code uses a "value" local, but doesn't declare it with one of the
&gt; CAMLlocalN variables, as the Ocaml Manual says is necessary (Ocaml Manual,
&gt; "Interfacing C with Objective Caml", Section 18.5.1, Rule 2). Is this code
&gt; above correct?

CAMLlocalN et al are for beginners.

They potentially waste time making things roots that don't
need to be. Best not to use them, just learn how the
collector works .. which you need to interface with it
anyhow :-)

-- 
John Max Skaller, mailto:skaller@ozemail.com.au
snail:10/1 Toxteth Rd, Glebe, NSW 2037, Australia.
voice:61-2-9660-0850


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

</contents>

</message>

