Type Aware GC Questions
Walter Bright
newshound at digitalmars.com
Mon Jan 29 15:59:16 PST 2007
Craig Black wrote:
> "Walter Bright" <newshound at digitalmars.com> wrote in message
> news:ephqje$1eje$2 at digitaldaemon.com...
>> Craig Black wrote:
>>> I was wondering, just how smart is the compiler now? If I define a class
>>> that doesn't have any pointers, then will the compiler know that it
>>> doesn't
>>> have pointers?
>> Yes.
>>
>>> If I only have one pointer in my class, will the GC only
>>> scan that location?
>> No, it'll scan the whole class. All it has is a bit that says "might have
>> pointers" or "has no pointers".
>
> If I have such a class, is there something I can do to inform the GC not to
> scan a certain portiion of memory?
>
>
See std.gc.hasNoPointers, std.gc.hasPointers.
More information about the Digitalmars-d
mailing list