|
@@ -179,7 +179,7 @@ var
|
|
|
crc : longint;
|
|
|
pl : plongint;
|
|
|
begin
|
|
|
- crc:=$ffffffff;
|
|
|
+ crc:=longint($ffffffff);
|
|
|
crc:=UpdateCrc32(crc,p^.size,sizeof(longint));
|
|
|
crc:=UpdateCrc32(crc,p^.calls,tracesize*sizeof(longint));
|
|
|
if extra_info_size>0 then
|
|
@@ -199,7 +199,7 @@ var
|
|
|
crc : longint;
|
|
|
pl : plongint;
|
|
|
begin
|
|
|
- crc:=$ffffffff;
|
|
|
+ crc:=longint($ffffffff);
|
|
|
crc:=UpdateCrc32(crc,p^.size,sizeof(longint));
|
|
|
crc:=UpdateCrc32(crc,p^.calls,tracesize*sizeof(longint));
|
|
|
if extra_info_size>0 then
|
|
@@ -313,9 +313,9 @@ begin
|
|
|
i:=0;
|
|
|
while pp<>nil do
|
|
|
begin
|
|
|
- if ((pp^.sig<>$DEADBEEF) or usecrc) and
|
|
|
+ if ((pp^.sig<>longint($DEADBEEF)) or usecrc) and
|
|
|
((pp^.sig<>calculate_sig(pp)) or not usecrc) and
|
|
|
- (pp^.sig <> $AAAAAAAA) then
|
|
|
+ (pp^.sig <> longint($AAAAAAAA)) then
|
|
|
begin
|
|
|
writeln(ptext^,'error in linked list of heap_mem_info');
|
|
|
RunError(204);
|
|
@@ -348,12 +348,12 @@ begin
|
|
|
inc(bp,sizeof(longint));
|
|
|
p:=SysGetMem(bp);
|
|
|
{ Create the info block }
|
|
|
- pheap_mem_info(p)^.sig:=$DEADBEEF;
|
|
|
+ pheap_mem_info(p)^.sig:=longint($DEADBEEF);
|
|
|
pheap_mem_info(p)^.size:=size;
|
|
|
if add_tail then
|
|
|
begin
|
|
|
pl:=pointer(p)+bp-sizeof(longint);
|
|
|
- pl^:=$DEADBEEF;
|
|
|
+ pl^:=longint($DEADBEEF);
|
|
|
end;
|
|
|
bp:=get_caller_frame(get_frame);
|
|
|
for i:=1 to tracesize do
|
|
@@ -412,13 +412,13 @@ begin
|
|
|
pp:=pheap_mem_info(p);
|
|
|
if not quicktrace and not(is_in_getmem_list(pp)) then
|
|
|
RunError(204);
|
|
|
- if (pp^.sig=$AAAAAAAA) and not usecrc then
|
|
|
+ if (pp^.sig=longint($AAAAAAAA)) and not usecrc then
|
|
|
begin
|
|
|
error_in_heap:=true;
|
|
|
dump_already_free(pp,ptext^);
|
|
|
if haltonerror then halt(1);
|
|
|
end
|
|
|
- else if ((pp^.sig<>$DEADBEEF) or usecrc) and
|
|
|
+ else if ((pp^.sig<>longint($DEADBEEF)) or usecrc) and
|
|
|
((pp^.sig<>calculate_sig(pp)) or not usecrc) then
|
|
|
begin
|
|
|
error_in_heap:=true;
|
|
@@ -442,7 +442,7 @@ begin
|
|
|
exit;
|
|
|
end;
|
|
|
{ now it is released !! }
|
|
|
- pp^.sig:=$AAAAAAAA;
|
|
|
+ pp^.sig:=longint($AAAAAAAA);
|
|
|
if not keepreleased then
|
|
|
begin
|
|
|
if pp^.next<>nil then
|
|
@@ -567,7 +567,7 @@ begin
|
|
|
dec(p,sizeof(theap_mem_info)+extra_info_size);
|
|
|
pp:=pheap_mem_info(p);
|
|
|
{ test block }
|
|
|
- if ((pp^.sig<>$DEADBEEF) or usecrc) and
|
|
|
+ if ((pp^.sig<>longint($DEADBEEF)) or usecrc) and
|
|
|
((pp^.sig<>calculate_sig(pp)) or not usecrc) then
|
|
|
begin
|
|
|
error_in_heap:=true;
|
|
@@ -608,12 +608,12 @@ begin
|
|
|
inc(getmem_size,size);
|
|
|
inc(getmem8_size,((size+7) div 8)*8);
|
|
|
{ Create the info block }
|
|
|
- pp^.sig:=$DEADBEEF;
|
|
|
+ pp^.sig:=longint($DEADBEEF);
|
|
|
pp^.size:=size;
|
|
|
if add_tail then
|
|
|
begin
|
|
|
pl:=pointer(p)+bp-sizeof(longint);
|
|
|
- pl^:=$DEADBEEF;
|
|
|
+ pl^:=longint($DEADBEEF);
|
|
|
end;
|
|
|
bp:=get_caller_frame(get_frame);
|
|
|
for i:=1 to tracesize do
|
|
@@ -723,10 +723,10 @@ begin
|
|
|
(cardinal(p)<=cardinal(pp)+sizeof(theap_mem_info)+extra_info_size+pp^.size) then
|
|
|
begin
|
|
|
{ check allocated block }
|
|
|
- if ((pp^.sig=$DEADBEEF) and not usecrc) or
|
|
|
+ if ((pp^.sig=longint($DEADBEEF)) and not usecrc) or
|
|
|
((pp^.sig=calculate_sig(pp)) and usecrc) or
|
|
|
{ special case of the fill_extra_info call }
|
|
|
- ((pp=heap_valid_last) and usecrc and (pp^.sig=$DEADBEEF)
|
|
|
+ ((pp=heap_valid_last) and usecrc and (pp^.sig=longint($DEADBEEF))
|
|
|
and inside_trace_getmem) then
|
|
|
goto _exit
|
|
|
else
|
|
@@ -754,7 +754,7 @@ begin
|
|
|
if (cardinal(p)>=cardinal(pp)+sizeof(theap_mem_info)+extra_info_size) and
|
|
|
(cardinal(p)<=cardinal(pp)+sizeof(theap_mem_info)+extra_info_size+pp^.size) then
|
|
|
{ allocated block }
|
|
|
- if ((pp^.sig=$DEADBEEF) and not usecrc) or
|
|
|
+ if ((pp^.sig=longint($DEADBEEF)) and not usecrc) or
|
|
|
((pp^.sig=calculate_sig(pp)) and usecrc) then
|
|
|
goto _exit
|
|
|
else
|
|
@@ -813,7 +813,7 @@ begin
|
|
|
Writeln(ptext^,'More memory blocks than expected');
|
|
|
exit;
|
|
|
end;
|
|
|
- if ((pp^.sig=$DEADBEEF) and not usecrc) or
|
|
|
+ if ((pp^.sig=longint($DEADBEEF)) and not usecrc) or
|
|
|
((pp^.sig=calculate_sig(pp)) and usecrc) then
|
|
|
begin
|
|
|
{ this one was not released !! }
|
|
@@ -821,7 +821,7 @@ begin
|
|
|
call_stack(pp,ptext^);
|
|
|
dec(i);
|
|
|
end
|
|
|
- else if pp^.sig<>$AAAAAAAA then
|
|
|
+ else if pp^.sig<>longint($AAAAAAAA) then
|
|
|
begin
|
|
|
dump_error(pp,ptext^);
|
|
|
{$ifdef EXTRA}
|
|
@@ -850,7 +850,7 @@ begin
|
|
|
pp:=heap_mem_root;
|
|
|
while pp<>nil do
|
|
|
begin
|
|
|
- pp^.sig:=$AAAAAAAA;
|
|
|
+ pp^.sig:=longint($AAAAAAAA);
|
|
|
pp:=pp^.previous;
|
|
|
end;
|
|
|
end;
|
|
@@ -992,7 +992,19 @@ finalization
|
|
|
end.
|
|
|
{
|
|
|
$Log$
|
|
|
- Revision 1.4 2000-11-13 13:40:03 marco
|
|
|
+ Revision 1.5 2000-12-07 17:19:47 jonas
|
|
|
+ * new constant handling: from now on, hex constants >$7fffffff are
|
|
|
+ parsed as unsigned constants (otherwise, $80000000 got sign extended
|
|
|
+ and became $ffffffff80000000), all constants in the longint range
|
|
|
+ become longints, all constants >$7fffffff and <=cardinal($ffffffff)
|
|
|
+ are cardinals and the rest are int64's.
|
|
|
+ * added lots of longint typecast to prevent range check errors in the
|
|
|
+ compiler and rtl
|
|
|
+ * type casts of symbolic ordinal constants are now preserved
|
|
|
+ * fixed bug where the original resulttype wasn't restored correctly
|
|
|
+ after doing a 64bit rangecheck
|
|
|
+
|
|
|
+ Revision 1.4 2000/11/13 13:40:03 marco
|
|
|
* Renamefest
|
|
|
|
|
|
Revision 1.3 2000/08/24 09:01:07 jonas
|