On 08 Apr 2010, at 15:05, C Western wrote:

How about an alternative implementation, without the integer recording size? I had a quick try at this - the only use of the MemSize routine in fpc+lazarus seems to be in an optimization in resizing strings. If this routine is adjusted to cope with MemSize returning 0 to indicate "not known" then most applications should work.

Having "most" applications work is a great recipe for annoying bug reports (and annoyed users).

This implementation as the additional advantage that mixing malloc and free's between C and Pascal then work.

That would indeed be nice, but I don't think it is feasible. Someone who values such functionality more than a full implementation of the memory manager can always install their own memory manager.

PS: The CFreeMemSize seems to be incorrectly implemented - it does not offset the pointer.

It calls CFreeMem, which does perform the adjustment.


Jonas
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to