Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Patrick Goldbronn - SYSCO <patrick.goldbronn@cea.fr>
To: caml-list@inria.fr
Subject: trouble with C pointers and GC
Date: Mon, 19 Apr 1999 16:42:30 +0200	[thread overview]
Message-ID: <371B40D6.1760563E@cea.fr> (raw)

Hello,

I have some trouble to return a structure with pointers outside the heap
!

I allocate two C pointer :

  adr1 = (double *) calloc(nb1,sizeof(double)); 
  adr2 = (int *) calloc(nb2,sizeof(int)); 

and I want to put it in a value with Final_tag :

  result = alloc_final( n , free_function , nb_elm*2 , 1  ) ;

I don't know what is the value of n (n words) : A pointer value
represent 1 word or 2 ?

How can I store the pointers adr1 and adr2 in value result and how can I
retrieve them (with Store_field and Field ?) ?

Thank you for your assistance.

-- 
######################
# Patrick GOLDBRONN  #
# CEA- DRN/DMT/SYSCO #
######################




             reply	other threads:[~1999-04-19 17:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <patrick.goldbronn@cea.fr>
1999-04-19 14:42 ` Patrick Goldbronn - SYSCO [this message]
1999-04-19 18:50   ` doligez

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=371B40D6.1760563E@cea.fr \
    --to=patrick.goldbronn@cea.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