www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Role of third argument to GC.addRange

reply =?UTF-8?B?Tm9yZGzDtnc=?= <per.nordlow gmail.com> writes:
The docs for the third argument to

https://dlang.org/library/core/memory/gc.add_range.html

says:

"The GC might use this information to improve scanning for 
pointers or to call finalizers."

Can somebody elaborate a bit on what "improve scanning" means 
here?
Oct 27
next sibling parent Adam D. Ruppe <destructionator gmail.com> writes:
On Friday, 27 October 2017 at 14:18:02 UTC, Nordlöw wrote:
 Can somebody elaborate a bit on what "improve scanning" means 
 here?
I believe it is so it can skip scanning stuff like ubyte[] for pointers and in the future might be used for precise scanning on structs with pointers and data combined.
Oct 27
prev sibling parent Steven Schveighoffer <schveiguy yahoo.com> writes:
On 10/27/17 10:18 AM, Nordlöw wrote:
 The docs for the third argument to
 
 https://dlang.org/library/core/memory/gc.add_range.html
 
 says:
 
 "The GC might use this information to improve scanning for pointers or 
 to call finalizers."
 
 Can somebody elaborate a bit on what "improve scanning" means here?
Currently, the TypeInfo is needed if you want to call the destructor of a struct. Eventually, if we ever have precise scanning, the TypeInfo may provide a way to only scan reference types within the block, eliminating sources of false pointers. -Steve
Oct 27