Eclipse OMR project provides a reusable Garbage Collector

Chris Wright via Digitalmars-d digitalmars-d at puremagic.com
Sat Dec 3 07:45:00 PST 2016


On Sat, 03 Dec 2016 15:21:02 +0000, Chris Wright wrote:

> On Sat, 03 Dec 2016 10:29:02 +0000, Dibyendu Majumdar wrote:
>> I would imagine that some effort is necessary ... but the payoff is
>> huge isn't it ? To have a robust GC would change the game for D.
>> It said that the OMR expects objects to be allocated on 8-byte aligned
>> memory and it requires one GC byte - which is assumed to be at the
>> start of the allocated object but can be changed if required.
> 
> One byte for the GC, or one byte of overhead for the glue layer to use?
> 
> Assuming that all structs are padded to word boundaries, one byte would
> allow a 256-word struct. I can create a struct with 10,000 fields, and
> each can be more than one word.

Also, OMR assumes there are no unaligned pointers to GC memory. So if I 
wrote the following (perfectly valid) D code, it would crash:

class Foo {
  bool[4] bools;
}
auto a = &new Foo().bools[1];


More information about the Digitalmars-d mailing list