Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Avoid pushing Floating point context onto current stack?

0 views
Skip to first unread message

Ira Baxter

unread,
Mar 3, 2007, 12:47:15 PM3/3/07
to
I have an application which wants to heap-allocation action records,
including stacks inside each activation record..
I don't need a large (1Mb) stack for each of these threads,
and none of them are calling Windows functions; they are all
bits of pure computation, and in fact a large stack area prevents
my code from doing deep recursions (1Mb stack * 4,000 recursive
calls, and I'm out of memory!). They do need modest amounts
of stack, e.g, 64 bytes to a few kilobytes.

These threads must handle occasional float-divide-by-zero exceptions.
One problem I have is that when a floating point exception occurs,
Windows seems to push all the floating point context onto
the current stack. That stack context is pretty big, ~~512 bytes,
likely "pushed" using the x86 FXSAVE instruction.
This means all my stacks must have whatever space they need,
plus this extra overhead.

My applications aren't interested in this state when an
exception occurs. So I'd be happy to not store it all,
or store it in well known place just to get rid of it.
Can this be done under Windows? How?

-- Ira Baxter


0 new messages