Can there be added helper functions for MS iMalloc support ?
https://msdn.microsoft.com/ru-ru/library/windows/desktop/ms678425.aspx
This interface can be consumed by MS libraries such as XMLLite for heap management. It potentially can optimize application memory layout by avoiding using of concurrent heap managers.
Three methods are already mapped: iMalloc // FastMM4 AllocMem -> GetMem ReAllocMem -> ReAllocMem Free -> FreeMem
However there are three more methods.
HeapMinimize : Minimizes the heap as much as possible by releasing unused memory to the operating system, coalescing adjacent free blocks, and committing free pages. // might be implemented by a do-nothing stub, or might really enforce deferred memory freeing, if FastMM has such a concept.
DidAlloc : Determines whether this allocator was used to allocate the specified block of memory. // might be "implemented" by stub, always returning -1 aka "I don't know" value
GetSize : Retrieves the size of a previously allocated block of memory. // this part is tricky, it asks "how much memory was really allocated" including extra slack for potential future growth // a rather convoluted code of this kind is within ReAllocMem routine, but it is way more convoluted to justify copy-past. May that code be extracted to a separate helper function ? Inlined one, if extra indirection would hurt performance badly (but will it? there are already calls to (un-)locking small/med/big segs anyway)?
Sounds like a good feature to have. I'm swamped with other work for the foreseeable future, but you're welcome to take a shot at it. :)
Truly, I would not want to risk destabilizing a codebase so many people depend upon daily.... I have little knowledge of FastMM internals and there cross-dependence, so I would almost certainly ruin something