[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Heap usage and variable argument C functions
- From: "Brett Bibby" <research@...>
- Date: Wed, 22 Dec 2004 08:33:27 +0800
> Isn't this a Windows problem rather than a Lua problem? The problem
> being that various libraries secretly like to change the Floating Point
> Control register and don't always change it back. You know the kind of
> thing, you call a DirectX function which calls some dodgy "high
> performance" graphics driver and now all of your NaNs are signalling
> and the floating point exceptions are of the non-useful kind. Or your
> rounding mode has changed.
Yes, DX exhibits this problem, but Lua brings it out all on its own in
certain situations! I have confirmed many times that calling into Lua and
manipulating some Lua Numbers can cause the denormals and precision to
change. We have to wrap all calls into and out of Lua with _fpreset,
_control87 to keep it working correctly in all situations.