Type Aware GC Questions

Craig Black cblack at ara.com
Mon Jan 29 11:39:56 PST 2007


"Frank Benoit (keinfarbton)" <benoit at tionex.removethispart.de> wrote in 
message news:eplfkh$o2g$1 at digitaldaemon.com...
>> If I have such a class, is there something I can do to inform the GC not 
>> to
>> scan a certain portiion of memory?
>
> If I understand that correctly, you can have another class - probably a
> nested one - that holds the data.
>
> C will be scanned, but not the instance of C.Data
>
> class C {
>   // some references
>   Object o;
>   // Data
>   private static class Data{
>      // only non-reference types/data
>      int a;
>   }
>   private Data data;
>
>   public this(){
>      data = new Data;
>      data.a = 3;
>   }
> }
>

But that requires another heap allocation.

-Craig 





More information about the Digitalmars-d mailing list