mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-10-27 09:51:58 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			31 lines
		
	
	
		
			595 B
		
	
	
	
		
			ObjectPascal
		
	
	
	
	
	
			
		
		
	
	
			31 lines
		
	
	
		
			595 B
		
	
	
	
		
			ObjectPascal
		
	
	
	
	
	
| program checkmem;
 | |
| 
 | |
| uses exec, amigados;
 | |
| 
 | |
| var
 | |
|   chipfirst,
 | |
|   chipsecond,
 | |
|   fastfirst,
 | |
|   fastsecond : longint;
 | |
| 
 | |
| begin
 | |
| 
 | |
|   if ParamCount <> 1 then begin
 | |
|      writeln('Usage: CheckMem ProgramName');
 | |
|      halt(10);
 | |
|   end;
 | |
| 
 | |
|   chipfirst := AvailMem(MEMF_CHIP);
 | |
|   fastfirst := AvailMem(MEMF_FAST);
 | |
| 
 | |
| 
 | |
|   if Execute(ParamStr(1),0,0) then begin
 | |
|      chipsecond := AvailMem(MEMF_CHIP);
 | |
|      fastsecond := AvailMem(MEMF_FAST);
 | |
| 
 | |
|      writeln('Memory loss (Chip): ',chipsecond-chipfirst);
 | |
|      writeln('Memory loss (Fast): ',fastsecond-fastfirst);
 | |
|      halt;
 | |
|   end else writeln('Could''t run the program');
 | |
| end.
 | 
