The Callstack Trim tab allows you to specify symbols that should not appear in callstacks collected by Memory Validator.
The default options are shown below:
Callstack trim filters can help simplify the display of callstacks, making it easier to see effective rather than actual allocation locations.
There are two principal use case for this feature:
1.when an inline function definition allocates memory which is then used by your application.
2.when some functions wrap a function that is allocating memory but you don't want the wrapper functions appearing in your callstack. An example of this might be an in-house memory allocator that wraps the malloc/realloc/free functions.
By removing the symbol from the callstack, the memory appears to be allocated at the point of calling the inlined function, not inside it.
By way of example, the two images below show a callstack for allocating a BSTR using an inline function A2BSTR which calls another inlined function A2WBSTR, defined in the ATL header file atlconv.h.
The second version has had the inline functions (A2BSTR and A2WBSTR) filtered out so as not to appear in the callstack.
Add a symbol to the list of symbols to be filtered out of the beginning of callstacks:
•Add An entry is added to the list enter the name of the symbol press return or click anywhere outside of the field to confirm (or press escape to cancel)
•Remove removes any select entries in the list
•Remove All removes all symbol names, clearing the list
To edit an existing symbol, double click the list entry.
For a couple of specific cases, you can add multiple callstack filters at once, although note that these are already in the list by default.
•ATLconv add the default inline symbols used in the atlconv.h header file (T2BSTR, A2BSTR etc)
•MinGW add the default memory allocation and deallocation symbols used in the MinGW compiler (__Znwj, __Znaj, and __ZdlPv)
•C++ Builder add the symbols used in the C++ Builder compiler (_ClassCreate, and @ClassCreate$)
The callstack trim filters will be used the next time you monitor an application using Memory Validator.
If you need to trim the callstacks in the current session you can do that using the Apply Trim option.
•Apply Trim apply the callstack trim filters to callstacks that have already been collected. This will cause any displays with callstacks to refresh.
Reset All - Resets all global settings, not just those on the current page.
Reset - Resets the settings on the current page.