| Thread overview | |||||
|---|---|---|---|---|---|
|
March 04, 2016 Why not use the address of the TypeInfo symbol as TypeInfo.toHash()? | ||||
|---|---|---|---|---|
| ||||
After linking each _DxxTypeInfo_yyyy__initZ symbol should have a unique address, so why are we using hash of type name as TypeInfo.toHash()? I don't think this has anything to do with compacting GC. Is there something I'm missing? | ||||
March 03, 2016 Re: Why not use the address of the TypeInfo symbol as TypeInfo.toHash()? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Yuxuan Shui | On 3/3/2016 4:29 PM, Yuxuan Shui wrote:
> After linking each _DxxTypeInfo_yyyy__initZ symbol should have a unique address,
> so why are we using hash of type name as TypeInfo.toHash()?
> I don't think this has anything to do with compacting GC. Is there something I'm
> missing?
Because when working with DLLs (shared libraries) there may be more than one TypeInfo per type.
| |||
March 04, 2016 Re: Why not use the address of the TypeInfo symbol as TypeInfo.toHash()? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Friday, 4 March 2016 at 00:42:28 UTC, Walter Bright wrote:
> On 3/3/2016 4:29 PM, Yuxuan Shui wrote:
>> After linking each _DxxTypeInfo_yyyy__initZ symbol should have a unique address,
>> so why are we using hash of type name as TypeInfo.toHash()?
>> I don't think this has anything to do with compacting GC. Is there something I'm
>> missing?
>
> Because when working with DLLs (shared libraries) there may be more than one TypeInfo per type.
Hmmm, can we left _DxxTypeInfo_yyyy__initZ undefined in the shared libraries?
| |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply