Use CreateFiberEx instead of CreateFiber, ConvertThreadToFiberEx instead of ConvertThreadToFiber
- Allows specifying FIBER_FLAG_FLOAT_SWITCH to save FP registers (it doesnt by default on win32 but does on win64) - Specify a commit stack size one byte less than the reserve stack size or else Windows rounds up to the nearest allocation size above the desired size
This commit is contained in:
parent
46cb760641
commit
3b1f1f7b6a
|
@ -1284,11 +1284,11 @@ fcontext_t LIBCONTEXT_CALL_CONVENTION make_fcontext(void* sp, size_t size, void(
|
||||||
{
|
{
|
||||||
if (!threadHasFibers)
|
if (!threadHasFibers)
|
||||||
{
|
{
|
||||||
ConvertThreadToFiber(nullptr);
|
ConvertThreadToFiberEx(nullptr, FIBER_FLAG_FLOAT_SWITCH);
|
||||||
threadHasFibers = 1;
|
threadHasFibers = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
fcontext_t ctx = CreateFiber(size, (LPFIBER_START_ROUTINE) fiberEntry, nullptr );
|
fcontext_t ctx = CreateFiberEx(size - 1, size, FIBER_FLAG_FLOAT_SWITCH, (LPFIBER_START_ROUTINE) fiberEntry, nullptr );
|
||||||
fiberParams[ctx].entry = fn;
|
fiberParams[ctx].entry = fn;
|
||||||
|
|
||||||
return ctx;
|
return ctx;
|
||||||
|
|
Loading…
Reference in New Issue