pleriche / FastMM5

FastMM is a fast replacement memory manager for Embarcadero Delphi applications that scales well across multiple threads and CPU cores, is not prone to memory fragmentation, and supports shared memory without the use of external .DLL files.
287 stars 74 forks source link

Please add posibility to configure value of stack trace depth in runtime #8

Open jaclas opened 4 years ago

jaclas commented 4 years ago

Please add posibility to configure value of stack trace depth in runtime, by replacing constant CFastMM_StackTraceEntryCount with a variable (or setter procedure).

jaclas commented 4 years ago

On the Praxis forum you said that nobody needs a long call stack, that in practice a shorter one is enough. Here's an example from life, I use FastMM4, I have a modified source and the call stack is set to 25 items, but still it's not enough:

vps_2020 07 23_01

pleriche commented 4 years ago

Hi Jaclas,

On the Praxis forum you said that nobody needs a long call stack, that in practice a shorter one is enough.

I didn't put it in such strong terms, but anyhow, making the stack trace depth configurable runtime is on the to-do list. It is not a trivial change, so I can't make any promises.

Best regards, Pierre

pleriche commented 4 years ago

Hi Jaclas,

I have added support for configuring the depth of the allocation and free stack traces runtime. The minimum value is 0 (if you're tight on memory or you only need the other debug funtionality) and the maximum 64. The current default is 20.

The new calls are FastMM_SetDebugModeStackTraceEntryCount and FastMM_GetDebugModeStackTraceEntryCount.

Best regards, Pierre