mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-02 22:29:24 +01:00
Move update of fields counting allocated memory to after SysGetMem call
git-svn-id: trunk@41882 -
This commit is contained in:
parent
9d10f21b07
commit
7b3e027dc8
@ -509,8 +509,6 @@ var
|
|||||||
begin
|
begin
|
||||||
loc_info := @heap_info;
|
loc_info := @heap_info;
|
||||||
try_finish_heap_free_todo_list(loc_info);
|
try_finish_heap_free_todo_list(loc_info);
|
||||||
inc(loc_info^.getmem_size,size);
|
|
||||||
inc(loc_info^.getmem8_size,(size+7) and not 7);
|
|
||||||
{ Do the real GetMem, but alloc also for the info block }
|
{ Do the real GetMem, but alloc also for the info block }
|
||||||
{$ifdef cpuarm}
|
{$ifdef cpuarm}
|
||||||
allocsize:=(size + 3) and not 3+sizeof(theap_mem_info)+extra_info_size;
|
allocsize:=(size + 3) and not 3+sizeof(theap_mem_info)+extra_info_size;
|
||||||
@ -529,6 +527,10 @@ begin
|
|||||||
end;
|
end;
|
||||||
pp:=pheap_mem_info(p);
|
pp:=pheap_mem_info(p);
|
||||||
inc(p,sizeof(theap_mem_info));
|
inc(p,sizeof(theap_mem_info));
|
||||||
|
{ Update getmem_size and getmem8_size only after successful call
|
||||||
|
to SysGetMem }
|
||||||
|
inc(loc_info^.getmem_size,size);
|
||||||
|
inc(loc_info^.getmem8_size,(size+7) and not 7);
|
||||||
{ Create the info block }
|
{ Create the info block }
|
||||||
pp^.sig:=longword(AllocateSig);
|
pp^.sig:=longword(AllocateSig);
|
||||||
pp^.todolist:=@loc_info^.heap_free_todo;
|
pp^.todolist:=@loc_info^.heap_free_todo;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user