From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: weis Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA06580 for caml-redistribution@pauillac.inria.fr; Mon, 21 Feb 2000 18:06:24 +0100 (MET) Resent-Message-Id: <200002211706.SAA06580@pauillac.inria.fr> Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id LAA28660 for ; Fri, 18 Feb 2000 11:48:54 +0100 (MET) Received: from orzan.fi.udc.es (orzan.fi.udc.es [193.144.60.19]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id LAA04239 for ; Fri, 18 Feb 2000 11:48:53 +0100 (MET) Received: from krilin.dc.fi.udc.es (quintela@krilin.dc.fi.udc.es [193.144.51.196]) by orzan.fi.udc.es (8.9.3/8.9.1) with SMTP id LAA02009; Fri, 18 Feb 2000 11:48:44 +0100 (MET) Received: by krilin.dc.fi.udc.es (sSMTP sendmail emulation); Fri, 18 Feb 2000 11:48:43 +0100 Sender: quintela@krilin.dc.fi.udc.es To: David.Mentre@irisa.fr (David=?iso-8859-1?q?_Mentr=E9?=) Cc: caml-list@inria.fr Subject: Re: Calling C from OCaml, GC problems References: X-Url: http://carpanta.dc.fi.udc.es/~quintela From: "Juan J. Quintela" In-Reply-To: David.Mentre@irisa.fr's message of "16 Feb 2000 16:41:42 +0100" Date: 18 Feb 2000 11:48:43 +0100 Message-ID: User-Agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.5 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Resent-From: weis@pauillac.inria.fr Resent-Date: Mon, 21 Feb 2000 18:06:23 +0100 Resent-To: caml-redistribution@pauillac.inria.fr > value mlbdd_alloc_manager(MANAGER m) { > CAMLparam0(); > CAMLlocal1 (result); > bdd_overflow_closure(m, mlbdd_overflow, NULL); > result = alloc_final(Size_ml_manager, mlbdd_free_manager, 0, 1); > Manager_store_pointer(result, (value)m); > PRINT_DEBUG("Alloc manager"); > CAMLreturn result; >} I think you need to protect m with CAMLparam1(m); otherwise in the allocation alloc_final, the garbage collector can be called and the address to m change. I hope this help. Later, Juan. -- In theory, practice and theory are the same, but in practice they are different -- Larry McVoy