[Gc] Storing pointers to GC objects in non-GC memory

David Given <[email protected]> Tue, 19 Aug 2014 00:34:17 +0200
Newsgroups gmane.comp.programming.garbage-collection.boehmgc
Organization Cowlark Technologies
Message-ID <[email protected]>
I'm trying to make libgc work with an Ada program.

Persuading Ada to allocate objects with libgc is pretty easy. Persuading
it to allocate *all* objects with libgc is rather hard --- in a modern
environment the standard libraries and runtimes are all precompiled
shared objects, so replacing their references to malloc() isn't really
an option.

According to the libgc docs, libgc doesn't scan blocks allocated with
system malloc(). This means that if I allocate a block from libgc, then
store the pointer in a block allocated with system malloc() --- such as
an Ada standard container data structure --- then libgc won't see the
pointer, will think the object is unreferenced, and free it, right?

Is there anything I can do here or am I fundamentally doomed? The exact
wording of the libgc docs are that libgc doesn't 'usually' scan blocks
from system malloc() --- what does 'usually' mean here?

-- 
┌─── dg@cowlark.com ───── http://www.cowlark.com ─────
│ "Blue is beautiful... blue is best...
│ I'm blue! I'm beautiful! I'm best!"
│ --- _Dougal and the Blue Cat_

_______________________________________________
bdwgc mailing list
[email protected]
https://lists.opendylan.org/mailman/listinfo/bdwgc
signature.asc (application/pgp-signature, 828 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.14 (GNU/Linux)

iQIVAwUBU/J/bHTPe2DYoi4EAQrmlw/9EkvY57jltuHZedvyeWzN7z6SY83sqLkK
4tEYEl5tVwYxoOJ73kVmr3P5wXiIxJxfdYd76p+LKuG4OE95LAZ/64sdBjK9/d+V
VSvkP0y7Q/TcD1j/rWTOQMRTrbA7Lo68dtp+dKH3/2sboaPpExmtSIYzs2hw2tCR
p7wz0ULQ4j3y2MpwqjnkMJ8dTzUY3VNDrdfRAcSE2Piy8n0fWiZIKaRb5YGvZGgn
9aeHhjYvXoiH1Wn5W3tAYg6i2GFxiq6ShLfEEy99lFW43nL/8qaGUewaVPn9MwLU
+cuDzHo1UL2K8dU0Vu/YjIBXx0S6b4eJJkD0Nr4XOM3EGuCvR1S+P/F++5uUqXAX
irjrvbPMxTmBz9M76n54MNORDFjN3FaDXJ6ONsxHEoEMmXZP1ixvV2FGNPRtB9OM
Ik0HzJgFWp6WkWWlE/PFI2fQyFI/U0r0Wmgp4uC2tHPjbaT0jjd1E3CaViVGP/1m
0YQ8pMxO/FIHLmCZ9Z/mEhlaY2PATLyyel3+CcZKEL1nu5eycG2dS7Zv+jGjfGOO
VrP4cDy3Z9JLjMrLnqCUumKNsSSyp6lYUGWgJ/LBtrHmYce0TxQh/K0h+m2VuA4l
CewuJWA62OAPPGumKbrdRIFYElsGVWMWuSX0bIDEJ5n+Z3IA2+s6RDAUpsZU78JV
6OyOzZHqqgU=
=GSF2
-----END PGP SIGNATURE-----