Date: Fri, 27 Jun 1997 06:48:42 -0400
Message-Id: <199706271048.GAA05146@dwarin.oit.umass.edu>
From: "Adam P. Jenkins" <ajenkins@cs.umass.edu>
To: caml-list@inria.fr
Subject: GC Bug?
In-Reply-To: <199706270913.FAA04748@dwarin.oit.umass.edu>
Adam P. Jenkins writes:
> Hi, I've been trying to write a C extension for O'Caml version 1.05,
> on Linux. I have a C object which I want to be able to pass into
> caml, and manipulate it with the C functions. I'm having some
> problems with allocation. Here's the smallest example I can give.
> I've even provided a Makefile, which creates a custom toplevel to test
> this in.
>
> The problem occurs in test_copy (see the C file below). For my
> abstract type, I just use two integers set to some magic values, which
> should never change. However, in copy, after I call alloc, sometimes
> the input parameter will change. Here's a sample session:
>
Hi, I'm following up to my own post because I figured out what the
problem was: I should have been saving the parameter in a root value
over the alloc call. I guess it was getting relocated sometimes by
the GC.
Sorry I can't post in French too; I only speak a da english. Good
day.
Adam
This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:11 MET