Notes for the next BdwGc conversion attempt:

Begin by removing conservative stack marking support and anything enabled by "--enable-checking".

Simplify allocation functions to remove any block allocation techniques. Use the vector allocation code as a model.

Check GC support functions for special behavior. E.g., Fgarbage_collect trims the undo list before anything else. Some fields may be effectively weak pointers, too.

It may be useful to keep staticpro for the time being. I think someone on the GC list mentioned that GCJ explicitly lists static roots to improve performance.

BdwGc does support mark/free functions -- see the Guile smob code for examples.

Maybe move weak hash table code into "alloc.c".

Move mark bits into external data structures? Or at least make it completely regular.

GTK code is somewhat tricky to convert; I don't understand what the callbacks are actually for and Emacs was crashing doing toolbar-related things.

Be careful about removing malloc-related conditionals (DOUG_LEA_MALLOC, etc.); Emacs does some stuff like installing malloc hooks which would still be useful for library functions that malloc.

A BDW-GC-based Emacs can reasonably require the following options to be in effect: no GC-related checks (GC_CHECK_*), GC_MARK_STACK disabled (and gcpros should be no-ops), SYNC_INPUT enabled. What about BYTE_MARK_STACK and REL_ALLOC? Note that SYNC_INPUT has been the default for some time and requiring it to be enabled means it's not necessary to block input during allocation.

BDW-GC is actually compatible with unexec! But libgc must be statically linked or else unexec cannot dump the GC state. It's also not clear that it's guaranteed to work with threading (although it's probably never an issue in practice).

Next:

Remove pure space support (maybe before BDWGCification even). XEmacs does just fine without it, and the functionality belongs in Guile if GuileEmacs is going to support it.

Similarly, Guile is not unexec-friendly -- actually I think even BDW-GC is not unexec-friendly as I got GC_REALLOC errors from a dumped Emacs, but maybe that was user error -- so we can assume that we CANNOT_DUMP.

In total, these changes will remove around 10-15 kLOC from GNU Emacs


CategoryGuileEmacs

EmacsGc (last edited 2012-05-31 06:38:35 by BtTempleton)