Thread overview | ||||||
---|---|---|---|---|---|---|
|
August 20, 2015 GC and MMM | ||||
---|---|---|---|---|
| ||||
Hi All! Does GC scan manually allocated memory? I want to use huge manually allocated hash tables and I don't want to GC scan them because performance reasons. Best regards, Ilya |
August 20, 2015 Re: GC and MMM | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ilya Yaroshenko | On Thursday, 20 August 2015 at 17:13:33 UTC, Ilya Yaroshenko wrote:
> Hi All!
>
> Does GC scan manually allocated memory?
> I want to use huge manually allocated hash tables and I don't want to GC scan them because performance reasons.
>
> Best regards,
> Ilya
Yes, just don't store any GC managed pointers in said manually allocated memory. Or at the very least consider any GC managed pointers to be weak pointers.
core.memory add/remove range have to be used put c malloc memory into the GC, simply don't call these functions.
|
August 20, 2015 Re: GC and MMM | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ilya Yaroshenko | On Thursday, 20 August 2015 at 17:13:33 UTC, Ilya Yaroshenko wrote:
> Hi All!
>
> Does GC scan manually allocated memory?
> I want to use huge manually allocated hash tables and I don't want to GC scan them because performance reasons.
>
> Best regards,
> Ilya
GC does not scan memory allocated with malloc from core.stdc.
|
August 21, 2015 Re: GC and MMM | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ilya Yaroshenko | On Thursday, 20 August 2015 at 17:13:33 UTC, Ilya Yaroshenko wrote:
> Hi All!
>
> Does GC scan manually allocated memory?
Only if you ask GC to do it - by calling core.memory.addRange.
|
Copyright © 1999-2021 by the D Language Foundation