caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Markus Mottl <markus.mottl@gmail.com>
To: Xavier Leroy <Xavier.Leroy@inria.fr>
Cc: david.baelde@ens-lyon.org,
	"Savonet's developpers list" <savonet-devl@lists.sourceforge.net>,
	Caml Mailing List <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] Re: Random segfaults / out of memory
Date: Tue, 30 Mar 2010 12:19:57 -0400	[thread overview]
Message-ID: <f8560b81003300919g3302ff1cm59c24a6df6b6a7a0@mail.gmail.com> (raw)
In-Reply-To: <4BB21F56.9070802@inria.fr>

On Tue, Mar 30, 2010 at 11:57, Xavier Leroy <Xavier.Leroy@inria.fr> wrote:
> Yes.  Actually, 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

-- 
Markus Mottl        http://www.ocaml.info        markus.mottl@gmail.com


      reply	other threads:[~2010-03-30 16:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-17  8:27 Rewriting the Digest module causes linking errors Goswin von Brederlow
2010-03-17  8:39 ` [Caml-list] " Mark Shinwell
2010-03-17  9:53   ` Goswin von Brederlow
2010-03-17 16:39     ` Random segfaults / out of memory [Was: Re: [Caml-list] Rewriting the Digest module causes linking errors] Goswin von Brederlow
2010-03-18 10:56       ` Random segfaults / out of memory Goswin von Brederlow
2010-03-30  7:14         ` [Caml-list] " David Baelde
2010-03-30 15:57           ` Xavier Leroy
2010-03-30 16:19             ` Markus Mottl [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f8560b81003300919g3302ff1cm59c24a6df6b6a7a0@mail.gmail.com \
    --to=markus.mottl@gmail.com \
    --cc=Xavier.Leroy@inria.fr \
    --cc=caml-list@yquem.inria.fr \
    --cc=david.baelde@ens-lyon.org \
    --cc=savonet-devl@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).