mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-11-04 06:59:33 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			30 lines
		
	
	
		
			530 B
		
	
	
	
		
			ObjectPascal
		
	
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			530 B
		
	
	
	
		
			ObjectPascal
		
	
	
	
	
	
program TestVm2;
 | 
						|
 | 
						|
procedure Test;
 | 
						|
var
 | 
						|
  P: Pointer;
 | 
						|
begin
 | 
						|
  P:=nil;
 | 
						|
  ReAllocMem(P, 8);
 | 
						|
  ReAllocMem(P, 0);
 | 
						|
  if P<>nil then
 | 
						|
    begin
 | 
						|
      Writeln('ReAllocMem wtih zero size does not set pointer to nil');
 | 
						|
      Writeln('Bug 813 is not yet fixed');
 | 
						|
      Halt(1);
 | 
						|
    end;
 | 
						|
end;
 | 
						|
 | 
						|
var MemBefore : longint;
 | 
						|
begin
 | 
						|
  writeln(MemAvail);
 | 
						|
  MemBefore:=MemAvail;
 | 
						|
  Test;
 | 
						|
  writeln(MemAvail);
 | 
						|
  if MemBefore<>MemAvail then
 | 
						|
    begin
 | 
						|
      Writeln('ReAllocMem creates emory leaks');
 | 
						|
      Writeln('Bug 812 is not yet fixed');
 | 
						|
    end;
 | 
						|
end.
 |