- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there any approved way of peeking at the ALLOCATE and DEALLOCATE goings-on?
I've managed to kludge together some code that can log those commands, so we can catch memory leaks, but it's thru very non-standard ways.
Some readily accessible procedure hooks (EXTERNAL variables) would be wonderful.
Until then we'll have to hex edit "FOR_ALLOCATE" to "ACT_ALLOCATE" in the libraries and other less than sterling hacks.
Thanks,
George
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here's a more elegant less inelegant hack of mine (for a different purpose, but mostly reusable); it works only for allocatables (not for pointers), as for_alloc_allocatable calls for_allocate (for pointers, for_allocate is called directly). I'm not sure at the moment whether there is one or two routines for deallocation.
Since you sound like a capablekludger hacker, you might tweak the idea further, by "subclassing" the for_allocate and for_deallocate routines:
Since you sound like a capable
- Write your own for_allocate and for_deallocate routines, as I suggested there (you got the prototype for the first in that code, and you have to reverse-engineer the second by examining assembly code); maybe Steve will be kind enough to post it.
- In those routines, do the logging and pass the arguments to the original for_allocate/for_deallocate. The easiest way is to
- use dll version of run-time library (I assume you only need this for debugging, right?)
- use GetModuleHandle("libifcorert.dll") and GetProcAddress to get a pointer to them
- call them
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page