caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Segfault using malloc within stubs
@ 2005-02-06  7:38 julius
  0 siblings, 0 replies; only message in thread
From: julius @ 2005-02-06  7:38 UTC (permalink / raw)
  To: caml-list

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-02-06  7:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-06  7:38 Segfault using malloc within stubs julius

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).