Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: micha <micha-1@fantasymail.de>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] allocating memory for c-structures
Date: Tue, 26 Dec 2006 19:55:15 +0100	[thread overview]
Message-ID: <45917013.4060900@fantasymail.de> (raw)
In-Reply-To: <20061226183547.GA29273@furbychan.cocan.org>

thanks for all the answers.

Richard Jones schrieb:
>
> That seems like it'll work for "opaque" C objects, but it's a bit of a
> hack.  The immediate issues I can think are:
>
> (a) Pointers in the C code which point at the object will not be
> "counted" by the GC, and so the object may be collected while there
> are still C pointers around.  This is easily avoided in OCaml, but
> read chapter 18 of the manual carefully.
>   
that's true; for linked data structures it would not work (except all
would be allocated this way)


> Actually, while I was writing the above, it struck me that perhaps
> you're talking about some sort of marshalling system?  OCaml supports
> its own marshalling format, and a rich variety of other external forms
> of marshalling.
ah no, I just thought that it would be another way to handle external
memory.
What I didn't realize was, that the gc moves pointers around...

cheers
Michael



  reply	other threads:[~2006-12-26 18:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-26 18:15 micha
2006-12-26 18:33 ` [Caml-list] " skaller
2006-12-26 18:35 ` Richard Jones
2006-12-26 18:55   ` micha [this message]
2006-12-26 18:32 EL CHAAR Rabih   SGAM/AI/SAM

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=45917013.4060900@fantasymail.de \
    --to=micha-1@fantasymail.de \
    --cc=caml-list@yquem.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