[Gc] Best way to avoid registering data segments in dynamically loaded libraries

Kjetil Matheussen <[email protected]> Fri, 15 Jul 2016 00:00:22 +0200
Newsgroups gmane.comp.programming.garbage-collection.boehmgc
Message-ID <CAC6niE+ZjWhutvswe3LsE7xutc+piUGRH5=ZA+v0TWJdPMpb4Q@mail.gmail.com>
--===============0885999349==
Content-Type: multipart/alternative; boundary=001a11401500f22e6c05379fa0d1

--001a11401500f22e6c05379fa0d1
Content-Type: text/plain; charset=UTF-8

Hi,

I'm getting reports that my program sometimes stutter a little bit, and
that turning off the garbage collector fixes it.

So I thought I should try to minimize the root set by avoiding to load
the data segments of dynamically loaded libraries, since I know
that there are no root pointers there.

In gc.h, the most straight forward way seems to be calling
'GC_set_no_dls()',
But the documentation for it says:

  "In some environments like Microsoft Windows

   and Apple's Darwin, this may also prevent
   registration of the main data segment as part
   of the root set"

This sounds a bit scary. Is this correct?

Perhaps it's better to implement the 'GC_has_static_roots_func'
callback, and always let it return 0?

Thanks for any help.

--001a11401500f22e6c05379fa0d1
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div><div>Hi,</div><div><br></div><div>I&#39;m getting rep=
orts that my program sometimes stutter a little bit, and</div><div>that tur=
ning off the garbage collector fixes it.</div><div><br></div><div>So I thou=
ght I should try to minimize the root set by avoiding to load</div><div>the=
 data segments of dynamically loaded libraries, since I know</div><div>that=
 there are no root pointers there.</div><div><br></div><div>In gc.h, the mo=
st straight forward way seems to be calling &#39;GC_set_no_dls()&#39;,</div=
><div>But the documentation for it says:</div><div><br></div><div>=C2=A0 &q=
uot;In some environments like Microsoft Windows =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0</div><div>=C2=A0 =
=C2=A0and Apple&#39;s Darwin, this may also prevent</div><div>=C2=A0 =C2=A0=
registration of the main data segment as part</div><div>=C2=A0 =C2=A0of the=
 root set&quot;</div><div><br></div><div>This sounds a bit scary. Is this c=
orrect?</div><div><br></div><div>Perhaps it&#39;s better to implement the &=
#39;GC_has_static_roots_func&#39;</div><div>callback, and always let it ret=
urn 0?</div><div><br></div><div>Thanks for any help.</div></div><div><br></=
div></div>

--001a11401500f22e6c05379fa0d1--

--===============0885999349==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
bdwgc mailing list
[email protected]
https://lists.opendylan.org/mailman/listinfo/bdwgc
--===============0885999349==--