Thanks for the links Robert ...
I appreciate the effort Frankie put towards the issue but it still seems like an unstable kludgefest to me.
I extracted and tested his last reworking of _msize ( which he renamed _fmsize ) and found it (gracefully) failed.
I submitted a _msize tweak under Feature Request on Pelles forum last evening. I don't expect it to go anywhere.
I toyed with the following this morning:
C_DECLARE FUNCTION My_msize LIB "msvcrt.dll" ALIAS "_msize" ( PV as void ptr) AS INTEGER
DIM Buffer$ * 100 ' BCX adds an extra 256 bytes for a total of 356 bytes
DIM b AS INTEGER
b = My_msize (Buffer$)
PRINT b
Pelles, LccWin32, and Mingw all compile it.
Output from the .Exe's is another matter ...
Mingw
356
Pelles C
-1
LccWin32
72756
I initially used DECLARE but changed to C_DECLARE as _msize uses the cdecl calling convention.
The only obvious thing that changed was that Pelles no longer throws an unhandled exception but it still fails to report the size.
One opinion that resonates with me is, if one wants to reliably know the current allocation of an object,
one must save that information when the allocation is successfully invoked ( malloc(), calloc(), realloc() ... )
Sorry to say, the _msize air is slipping away from beneath my wings.