ae.sys.memory

Memory and GC stuff.

Members

Functions

assertNotInCollect
void assertNotInCollect()

Asserts that we are not inside a GC collection cycle, by performing a no-op GC operation. If we are, an InvalidMemoryOperationError is raised by the runtime.

gcRan
bool gcRan()

Did the GC run since this function's last call on this thread? Not 100% reliable (due to false pointers).

inCollect
bool inCollect()

Checks if we are inside a GC collection cycle. This is currently done in a dumb and expensive way, so use sparingly.

onStack
bool onStack(const(void)* p)

Is the given pointer located on the stack of the current thread? Useful to assert on before taking the address of e.g. a struct member.

Meta

License

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

Authors

Vladimir Panteleev <ae@cy.md>