From: julius <flute@noos.fr>
To: caml-list@inria.fr
Subject: Segfault using malloc within stubs
Date: Sun, 06 Feb 2005 08:38:06 +0100 [thread overview]
Message-ID: <4205C95E.8050404@noos.fr> (raw)
Hello,
I have this strange problem with my stubs, I wrote this function but it
leads to a segfault:
CAMLprim value foo(value v)
{
CAMLparam1(v);
CAML(result);
char** test;
test=(char**)malloc(4*sizeof(char*));
CAMLreturn(result);
}
After much tests, it seems that malloc is not allowed when using Caml
data types or when trying to register data to the ocaml garbage
collector... But I don't understand why as C heap and OCaml heap are
distinct :-/
Thanks,
Julius
reply other threads:[~2005-02-06 7:34 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=4205C95E.8050404@noos.fr \
--to=flute@noos.fr \
--cc=caml-list@inria.fr \
/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