Original Post
🔒 Locked
C Stack Probe
Advertisement
From what I gather a stack probe tests if a variable is declared on the stack or on the heap. And calling free/delete on objects on the stack can lead to troubles. Here''s a snippet: Object On The Stack
There''s a win32 stackwalk program here: Stackwalk
There''s a win32 stackwalk program here: Stackwalk
why would anyone want to call delete on a variable on the stack??
my understanding is that when you call new, the pointer returned is on a heap.
if i dont want to use the stack probe, is there any performance gain if i remove stack probes?
Its my duty, to please that booty ! - John Shaft
my understanding is that when you call new, the pointer returned is on a heap.
if i dont want to use the stack probe, is there any performance gain if i remove stack probes?
Its my duty, to please that booty ! - John Shaft
quote:
Original post by jwalker
why would anyone want to call delete on a variable on the stack??
my understanding is that when you call new, the pointer returned is on a heap.
That was the gist of the intro, the ensuing discussion touches on that point. Use of the crt memory debugging functions is invoked.
quote:
Original post by jwalker
if i dont want to use the stack probe, is there any performance gain if i remove stack probes?
I would think so, but if it''s just a compiler setting, try it and test the result.
That profiling code is tasty. Too bad it''s compiler dependent.
quote:
Original post by jwalker
other than profiling and ''walking the stack'' whats the benefit of leaving in the stack probe in release mode ?
Limit the use of the stack probe to responding to an unhandled exception. If one occurs, performance is already affected, walking the stack isn''t going to change that. Dump the callstack and register values to an error log. The next time the program is started, you can prompt the user to email you the report. Format the text for email and pass it along to the default mail handler. The extra code doesn''t add much to the app - 10 Kb. Having a little bit of error data is better than having none at all. There''s an "under the hood" column that addresses logging a stack walk in this fashion. The article doesn''t cover the email part.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement