RE: [GD-Windows] autodocument max stack usage
Brought to you by:
vexxed72
From: Roland <ro...@wi...> - 2001-10-25 19:36:04
|
> -- So, back to the _TOPIC_. Is there a linker output for > it, or not. (even > on the module level). I don't know, if there's a linker output for it... (now I'm gonna get flamed...:-))... but .... I did a little app a while back, where I totally removed the C runtime from the final executable. (The purpose was to get a tiny tiny Win32 app). Without linking to the C runtime, I had to implement all runtime functions used myself or let the compiler generate intrinsic functions. Somehow there was one function missing in DEBUG or RELEASE builds (don't remember which one it was, but I guess it was DEBUG): _chkesp() I looked at the assembly source and as far as I know this function was called on almost every function leave. I think it's used to verify that a function didn't mess with the stackframe... Below is my implementation to get the linker happy, but I think you might blow this function up a bit and monitor the ESP/EBP contents a get some idea on stack usage from that... Just a thought roland SmallIO.cpp: ..... extern "C" { __declspec(naked) void __cdecl _chkesp(void) { _asm { ret 0; } } }; ..... |