@PascalDragon
In general, but focussing on cmem:
If you leave out the size, Lazarus doesn't work - but Fpc does! -. Try it yourself using cmem as a template, simply rip out the silly size management.
So Lazarus relies on implementation detail.
This behavior is also documented, although obfuscated (freemem remark)
https://forum.lazarus.freepascal.org/index.php?action=post;topic=46420.15;last_msg=331064The "should" should be replaced with "must" but
only for Lazarus.
(Actually I think this is quite a substantial bug in Lazarus)
It is enough to move the declarations from interface to implementation. (These should not have any use there whatever any memory manager implementation)
Actually, I would recommend to move the declarations to the implementation section just because of that!
Problem: Lazarus people: And now what??????????
To my knowledge, Compiler and RTL do not rely on size in the memory manager at all.