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 50F77BC57 for ; Tue, 30 Mar 2010 18:19:58 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhQCAAfCsUtKfVK0mGdsb2JhbACRDIoaCBUBAQEBAQgJDAcRIrAOgWqFPS2ITAEBAwWEewQ X-IronPort-AV: E=Sophos;i="4.51,335,1267398000"; d="scan'208";a="48063741" Received: from mail-wy0-f180.google.com ([74.125.82.180]) by mail2-smtp-roc.national.inria.fr with ESMTP; 30 Mar 2010 18:19:58 +0200 Received: by wya21 with SMTP id 21so5519877wya.39 for ; Tue, 30 Mar 2010 09:19:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=7rwVHh/PWM86afDmRm1kkJrEVNuNMpvmzxEd1qH+mfo=; b=VPtUWicibqb9vuOJMyqzn5y94JtpqtJS2M54bPmAW46JpK/AMcyfie6X2f+qKkhzHO Q3d18bVd3wg1R/YQ+BCc+SUXji8Pj7BsYQaiaHPjo2Us+ttP1CqS6Is4+RtGiQo+IfGR B9UyRcbhPG1aIO67eOqIddiQSoIYs3E88nS78= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=k8K6MEHtE2vT25jw/ForAvSYieTlCkGtjZS16I5jvzr84nmR/iSglzAQdaDoxcAjYP pJQgxFwQt06B6IeIKD1Z99+2jAoODXSBHd59ywvhlK/RquXtsxzEVZlebN4eK9Yc3cwJ x3YMMY5SZvB4+q27t7a+6KAxAJRfXrFO6LGMg= MIME-Version: 1.0 Received: by 10.216.51.12 with HTTP; Tue, 30 Mar 2010 09:19:57 -0700 (PDT) In-Reply-To: <4BB21F56.9070802@inria.fr> References: <87wrxb5p59.fsf@frosties.localdomain> <20100317083907.GC26002@janestreet.com> <87sk7zgtpq.fsf@frosties.localdomain> <87hboehphv.fsf_-_@frosties.localdomain> <874okd2907.fsf@frosties.localdomain> <53c655921003300014s2c7b05eax24b91edbb0d0d9ec@mail.gmail.com> <4BB21F56.9070802@inria.fr> Date: Tue, 30 Mar 2010 12:19:57 -0400 Received: by 10.216.86.193 with SMTP id w43mr4171514wee.16.1269965997405; Tue, 30 Mar 2010 09:19:57 -0700 (PDT) Message-ID: Subject: Re: [Caml-list] Re: Random segfaults / out of memory From: Markus Mottl To: Xavier Leroy Cc: david.baelde@ens-lyon.org, "Savonet's developpers list" , Caml Mailing List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam: no; 0.00; segfaults:01 markus:01 mottl:01 markus:01 mottl:01 ocaml:01 runtime:01 ocaml:01 val:01 wrote:01 caml-list:01 int:01 caml:02 breaks:02 api:02 On Tue, Mar 30, 2010 at 11:57, Xavier Leroy wrote: > Yes. =A0Actually, it is forbidden to call any function of the OCaml > runtime system from a noalloc function. It may not always be clear to developers whether a function provided by the OCaml API is safe. E.g. calling Val_int is fine (at least now and for the foreseeable future), but caml_copy_string is not. I agree that people should generally avoid noalloc. The speed difference is clearly negligible in almost all practical cases. Note, too, that sometimes people forget that they had declared a previously safe function as "noalloc", but later change the C-code in ways that breaks this property. The tiny extra performance may not be worth that risk. Regards, Markus --=20 Markus Mottl http://www.ocaml.info markus.mottl@gmail.com