caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] GC and preventing data relocation
@ 2003-03-20 15:16 Markus Mottl
  2003-03-20 18:28 ` Christopher Quinn
  2003-03-21 16:15 ` Damien Doligez
  0 siblings, 2 replies; 9+ messages in thread
From: Markus Mottl @ 2003-03-20 15:16 UTC (permalink / raw)
  To: OCAML

Hello,

I have just started to integrate a new feature into PCRE-OCaml that
would allow callbacks ("callouts") during pattern matching. However,
if I'm not mistaken, there is a severe problem for which I don't know
any good workaround:

Among other things, my C-function gets a string value and passes it to
a C-library for pattern matching together with information on what to
do in the case of "callouts" in the regular expression. If the C-engine
detects such an indicator, my wrapper code is called again and receives
the callout data (e.g. an array of callout closures provided by the
OCaml-code).

When my code calls OCaml again via one of those closures, this may,
of course, trigger the GC. Unfortunately, the GC may feel like moving
data around, e.g. the string which is currently still in use by the
C-engine of the library. Needless to say that this may cause trouble!
Copying the string internally into the C-heap to prevent this would be
really bad due to performance/memory reasons...

Since there is no way for me to tell the C-library to continue with a
new location of the string, I'd like to know whether there is any way
to prevent the GC from moving specific data?

Best regards,
Markus Mottl

-- 
Markus Mottl                                             markus@oefai.at
Austrian Research Institute
for Artificial Intelligence                  http://www.oefai.at/~markus

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2003-03-24  8:58 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-20 15:16 [Caml-list] GC and preventing data relocation Markus Mottl
2003-03-20 18:28 ` Christopher Quinn
2003-03-21  0:01   ` Markus Mottl
2003-03-21  1:15     ` Christopher Quinn
2003-03-21 12:03       ` Markus Mottl
2003-03-21 16:15 ` Damien Doligez
2003-03-21 16:35   ` Markus Mottl
2003-03-24  6:14     ` Nicolas Cannasse
2003-03-24  8:58       ` Markus Mottl

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