reduce GC code overhead #54

Closed
cadrian opened this Issue Mar 13, 2013 · 3 comments

2 participants

@cadrian
Liberty Eiffel member

See http://smarteiffel.loria.fr/papers/ismm98.pdf

Code reduction comes from equivalent data structures.

  • gc identifiers and structures must be distinct from LIVE_TYPE identifiers
  • live types must know their canonical structure (number of pointers and so on) by a clever code similar to LIVE_TYPE.structure_signature
  • there must be a correspondence LIVE_TYPE -> GC structure
@ramack
Liberty Eiffel member

I did not fully read your link, but let me describe my understanding - please correct me if I got something wrong:

  • a LIVE_TYPE is an actually used type
  • we have now one mark-function and one sweep-function per type
  • you suggest to store the structure of each object such that generic mark and sweep functions can dynamically decide which elements in the object are pointers which have to be considered during GC

First I though you'd suggest to use one mark/sweep function pair for different LIVE_TYPEs with the same object structure, but I'd doubt that there are many different types with the same structure. - Even tough I'm not convinced, it might be possible to group the pointers in a type together such that the structure only differs in the number of pointers at the end?

@cadrian
Liberty Eiffel member

The only important things for the GC are:

  • the number of "managed" pointers in each structure (i.e. pointers allocated by the GC itself); not their type
  • the actual size of each structure (which is pretty hard to calculate so I slightly widen the constraint as the actual number of each basic type: pointers, integers and so on)

So yes, I think we can reduce the number of customized mark functions. Ideally there could be one per "number of pointers". And there could be one sweep function per GC structure.

The nice side-effect would be a reduced number of memory chunks, maybe saving some memory.

To be further investigated.

@cadrian cadrian closed this Jun 7, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment