[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: | 1997-06-27 (12:15) |
From: | Adam P. Jenkins <ajenkins@c...> |
Subject: | GC Bug? |
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