From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 68922BBAF for ; Fri, 11 Jul 2008 10:21:57 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsACAI+0dkiBXvIYgWdsb2JhbACEUY1dAQEQIFGcXQ X-IronPort-AV: E=Sophos;i="4.30,343,1212357600"; d="scan'208";a="14994122" Received: from note.orchestra.cse.unsw.edu.au ([129.94.242.24]) by mail1-smtp-roc.national.inria.fr with ESMTP; 11 Jul 2008 10:21:55 +0200 Received: From [IPv6???1] ([129.94.242.130] == pill00.orchestra.cse.unsw.EDU.AU) (ident-user sseefried) (cse-authentic-sender sseefried) (for ) By note With Smtp ; Fri, 11 Jul 2008 18:21:52 +1000 From: Sean Seefried To: caml-list@yquem.inria.fr Date: Fri, 11 Jul 2008 18:21:51 +1000 Message-Id: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v924) Subject: Heaps size problems with "caml_alloc_small" in foreign function interfaces X-Mailer: Apple Mail (2.924) X-Spam: no; 0.00; alloc:01 alloc:01 stack:01 heap:01 heap:01 interfaces:01 caml:02 caml:02 seems:03 segmentation:03 fault:04 size:95 size:95 problem:05 function:08 Hi, I'm having a problem where sometimes a call to "caml_alloc_small" from C results in a segmentation fault. If I increase the size of the stack using OCAMLRUNPARAM=s=1000k then I don't get the crash anymore. It seems strange that I have to increase the size of the heap manually like this. Is this because I'm calling this function from C? If I want to increase the size of the heap in C how do I do this? Could I write a "safe" caml_alloc_small which first checks to see if there is enough memory and then increases the heap size if not? Sean