ScopedForeignCallback

RAII struct to cover extern callbacks. Nowadays it only deals with FPU/SSE control words save/restore.

When we used a D runtime, this used to manage thread attachment and deattachment in each incoming exported function.

Calling this on callbacks is still mandatory, since changing floating-point control work can happen and create issues.

struct ScopedForeignCallback (
bool dummyDeprecated
bool saveRestoreFPU
) {}

Destructor

~this
~this()
Undocumented in source.

Postblit

this(this)
this(this)
Undocumented in source.

Members

Functions

enter
void enter()

Call this in each callback.

Examples

extern(C) myCallback() { ScopedForeignCallback!(false, true) cb; cb.enter();

// Rounding mode preserved here... }

Meta