mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-22 00:29:33 +02:00
* allow freemem nil
git-svn-id: trunk@499 -
This commit is contained in:
parent
5c3a4516e1
commit
822f7f0f16
@ -1066,7 +1066,10 @@ var
|
||||
pcurrsize: ptrint;
|
||||
begin
|
||||
if p=nil then
|
||||
exit;
|
||||
begin
|
||||
result:=0;
|
||||
exit;
|
||||
end;
|
||||
pcurrsize := pmemchunk_fixed(p-sizeof(tmemchunk_fixed_hdr))^.size;
|
||||
{ check if this is a fixed- or var-sized chunk }
|
||||
if (pcurrsize and fixedsizeflag) = 0 then
|
||||
@ -1088,14 +1091,14 @@ var
|
||||
pcurrsize: ptrint;
|
||||
begin
|
||||
SysFreeMemSize := 0;
|
||||
if p=nil then
|
||||
exit;
|
||||
if size<=0 then
|
||||
begin
|
||||
if size<0 then
|
||||
HandleError(204);
|
||||
exit;
|
||||
end;
|
||||
if p=nil then
|
||||
HandleError(204);
|
||||
|
||||
pcurrsize := pmemchunk_fixed(p-sizeof(tmemchunk_fixed_hdr))^.size;
|
||||
{ check if this is a fixed- or var-sized chunk }
|
||||
|
@ -433,6 +433,11 @@ var
|
||||
{$endif}
|
||||
extra_size : ptrint;
|
||||
begin
|
||||
if p=nil then
|
||||
begin
|
||||
TraceFreeMemSize:=0;
|
||||
exit;
|
||||
end;
|
||||
inc(freemem_size,size);
|
||||
inc(freemem8_size,((size+7) div 8)*8);
|
||||
pp:=pheap_mem_info(p-sizeof(theap_mem_info));
|
||||
@ -554,6 +559,11 @@ var
|
||||
l : ptrint;
|
||||
pp : pheap_mem_info;
|
||||
begin
|
||||
if p=nil then
|
||||
begin
|
||||
TraceFreeMem:=0;
|
||||
exit;
|
||||
end;
|
||||
pp:=pheap_mem_info(p-sizeof(theap_mem_info));
|
||||
l:=SysMemSize(pp);
|
||||
dec(l,sizeof(theap_mem_info)+pp^.extra_info_size);
|
||||
|
Loading…
Reference in New Issue
Block a user