* handle SysTinyFreeMem(nil) properly (i.e. succeed silently, without writing to

nil pointer memory)

git-svn-id: trunk@26890 -
This commit is contained in:
nickysn 2014-02-26 22:01:50 +00:00
parent c00b56ae49
commit 858efec84e

View File

@ -180,6 +180,11 @@
{$ifdef DEBUG_TINY_HEAP}
Writeln('SysTinyFreeMem(', ptruint(Addr), ')');
{$endif DEBUG_TINY_HEAP}
if addr=nil then
begin
result:=0;
exit;
end;
sz := Align(FindSize(addr)+SizeOf(ptruint), sizeof(pointer));
InternalTinyFreeMem(@pptruint(addr)[-1], sz);