[RFA] boehm-gc for AIX

David Edelsohn dje@watson.ibm.com
Mon Jan 28 07:52:00 GMT 2002


>>>>> Fergus Henderson writes:

Fergus> For programs with a C main(), GCC will currently generate a call to
Fergus> __main() to handle C++ constructors.  Technically this is "distributed
Fergus> fat" -- it's an overhead that C programs pay even if they don't contain
Fergus> any C++ code -- but the cost is very very small, and the benefit in terms
Fergus> of programmer time saved is large, so it is well worth paying.

	No, GCC only generates a call to __main if HAS_INIT_SECTION is not
defined.

Fergus> It would not be OK to call GC_INIT() from main(), because that would
Fergus> cause the conservative collector to be linked in, which would be too
Fergus> much distributed fat.  However, I think the only part of GC_INIT() which
Fergus> really needs to be in main() is the references to DATA_START and DATA_END.

	How does calling GC_INIT (actually GC_set_roots) cause the
conservative collected to be linked in?  The main program references a
symbol in the boehm-gc shared library which already is a dependent library
because Java uses boehm-gc.

Fergus> Did I miss anything?

	I do not think you have your facts correct.

David



More information about the Gcc-patches mailing list