From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id DA913BBAF for ; Tue, 24 Aug 2010 16:21:10 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmICAGdyc0zRVdc0kGdsb2JhbACTK40LCBUBAQEBCQkMBxEDH6AOiRiCE4Y6LohUAQEDBYJwgkIEiXg X-IronPort-AV: E=Sophos;i="4.56,263,1280700000"; d="scan'208";a="57744413" Received: from mail-ew0-f52.google.com ([209.85.215.52]) by mail2-smtp-roc.national.inria.fr with ESMTP; 24 Aug 2010 16:21:10 +0200 Received: by ewy20 with SMTP id 20so3866025ewy.39 for ; Tue, 24 Aug 2010 07:21:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date :user-agent:references:in-reply-to:mime-version:content-type :content-transfer-encoding:message-id; bh=dGnjT6QqYmZNdt382O6RZyB2zF2Lh7NR0KLPWh2sUOk=; b=KPglPOw8tk62mJzdvuo7WOONcyxx1SHElKLHqpIFXhfjQdTgC9T2tnkyFy+2G/d0QC As8l9jL4NGCHkeqbQEcj78mLrGYyUF42M6v8AJFgj4DUN6ZVgqLAz0V8e1+yg/SXbecB uS/mDzEnF1MiGM1z09ddxfqQ0H6q63WrcF5Ak= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:references:in-reply-to:mime-version :content-type:content-transfer-encoding:message-id; b=gQUrgbyFWsLBA0ilWsebxwUCszPH4qaMXFy6L8J/4kkSUFPCYt0Cymnq46Z6jBJrgL jHLPRFLtkBxTsaHtYXoMGbup4oHau5LF5VLgUqxC+BgcBGVKtM4iyFU96oKE5919povZ S6fhYkRCdB1vp4SBNTSgKuA9YUPoFkRfwO10A= Received: by 10.216.10.11 with SMTP id 11mr834985weu.64.1282659670194; Tue, 24 Aug 2010 07:21:10 -0700 (PDT) Received: from localhost.localnet (pat35-5-78-226-58-147.fbx.proxad.net [78.226.58.147]) by mx.google.com with ESMTPS id w14sm102105weq.33.2010.08.24.07.21.08 (version=SSLv3 cipher=RC4-MD5); Tue, 24 Aug 2010 07:21:09 -0700 (PDT) From: Florent Monnier To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] caml_copy_string Date: Tue, 24 Aug 2010 16:21:02 +0200 User-Agent: KMail/1.13.3 (Linux/2.6.33.5-desktop586-2mnb; KDE/4.4.3; i686; ; ) References: <201008231409.06024.monnier.florent@gmail.com> <201008231524.49124.toots@rastageeks.org> In-Reply-To: <201008231524.49124.toots@rastageeks.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: quoted-printable Message-Id: <201008241621.02363.monnier.florent@gmail.com> X-Spam: no; 0.00; ocaml:01 buffer:01 allocations:01 buffer:01 segfault:01 48,:98 caml-list:01 caml:02 string:02 string:02 lundi:05 lundi:05 ecrit:06 ecrit:06 cases:08 Le lundi 23 ao=FBt 2010 22:24:48, Romain Beauxis a =E9crit : > Le lundi 23 ao=FBt 2010 07:09:05, Florent Monnier a =E9crit : > > an alternative method is to provide a string from ocaml to c then c fil= ls > > this buffer, then you can save allocations by reusing the same buffer, >=20 > > see: > This is a good idea but I would be a little bit suspicious about using > "noalloc". Even if it works in your tests, this options is very delicate = to > use with the Gc, and may segfault in some cases. could you develop? which cases? =2D-=20 Regards =46lorent