Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using a local clone.

core.internal.gc.blkcache

BlkInfo thread-local cache. Used for array appending in the conservative GC to avoid the lock when possible.

Note this used to be in rt.lifetime, but was moved here to allow GCs to take over array operations.

enum IsMarked: int;
Indicates whether an address has been marked by the GC.
no
Address is not marked.
yes
Address is marked.
unknown
Address is not managed by the GC.
alias IsMarkedDg = IsMarked delegate(void* addr) nothrow;
The isMarked callback function.
nothrow @nogc BlkInfo* __getBlkInfo(void* interior);
Get the cached block info of an interior pointer. Returns null if the interior pointer's block is not cached.

NOTE The following note was not valid, but is retained for historical purposes. The data cannot be cleared because the stack contains a reference to the affected block (e.g. through interior). Therefore, the element will not be collected, and the data will remain valid.

ORIGINAL The base ptr in this struct can be cleared asynchronously by the GC, so any use of the returned BlkInfo should copy it and then check the base ptr of the copy before actually using it.