bdwgc

D interface to the Boehm-Demers-Weiser Garbage Collector (BDWGC). Provides a structured allocator API for GC-managed memory with thread support.

Note: All allocations, including aligned ones, are GC-managed via BDWGC. Thread registration is required for multi-threaded applications when GCThreads is enabled.

Public Imports

c.gc
public import c.gc;

BDWGC C bindings

Members

Aliases

GC_printf
alias GC_printf = printf
Undocumented in source.

Functions

GC_allow_register_threads
void GC_allow_register_threads()
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
GC_printf
void GC_printf(const(char)* format, ...)

Formatted output for GC logging

GC_register_my_thread
void GC_register_my_thread()
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
GC_thread_is_registered
int GC_thread_is_registered()
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
GC_unregister_my_thread
void GC_unregister_my_thread()
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
isGoodDynamicAlignment
bool isGoodDynamicAlignment(uint x)

Checks if alignment is valid: a power of 2 and at least pointer size.

Structs

BoehmAllocator
struct BoehmAllocator

Allocator for BDWGC-managed memory, implementing IAllocator. Thread-safe and compatible with -betterC. Requires thread registration for multi-threaded use when GCThreads is enabled.

ThreadGuard
struct ThreadGuard

Manage BDWGC thread registration. Use ThreadGuard.create() to instantiate and register the current thread. Unregisters the thread on destruction. No-op if GCThreads is disabled.

Meta