Closed janrysavy closed 3 months ago
Thank you for the positive feedback.
Unfortunately I wasn't aware of the pattern that Microsoft was using back in 2004, so I went with the $80808080 pattern. It's probably a bit late in the game to change the value now, since users are already accustomed to it.
However, there isn't currently an option to pre-fill allocated blocks with a pattern and it would be possible to add such an option. I could use a different pattern for that, perhaps $81818181 (so it is somewhat similar to the pattern for freed blocks). Would that work for you?
Isn't FillDebugBlockWithDebugPattern called during allocations such as FastMM_DebugGetMem_GetDebugBlock?
Any solution is good for us.
Ah yes, you're right. I forgot about that. So basically you want it to use a different pattern in FastMM_DebugGetMem_GetDebugBlock?
Edit: It's only currently available in debug mode. Do you need a feature similar to FastMM_BeginEraseFreedBlockContent.
We just would like to distinguish whether it is allocated or released memory by different constant. Debug mode only is fine for us, we are using it in our internal brief & full debug builds.
I've changed the fill pattern for allocated blocks to $90909090. Please test the latest commit and let me know if it works for you.
Hello Pierre, thank you, it works perfectly.
I would like to return to your proposal to introduce an equivalent to FastMM_BeginEraseFreedBlockContent, but for allocated blocks. The memory fill is very fast, and we could use it permanently turned on, while the debug mode is computationally much more demanding. Would it be possible to add this mode as well?
I've added FastMM_BeginEraseAllocatedBlockContent and FastMM_EndEraseAllocatedBlockContent calls. When enabled it will fill newly allocated blocks with the $90909090 pattern.
Thank you.
Thank you for implementing FastMM_BeginEraseFreedBlockContent - it works great!
Could you please use a different pattern for allocated and freed memory? For reference, the Microsoft C++ debug runtime uses $CDCDCDCD for allocated memory and $DDDDDDDD for freed memory. You can find more details here: https://en.wikipedia.org/wiki/Magic_number_(programming)#Debug_values