Re: FastCode MM B&V 0.55
- From: "Dennis" <marianndkc@xxxxxxxxxxxxxxx>
- Date: Sat, 29 Oct 2005 17:47:22 +0200
Hi
Validate13 allocates 16 kB blocks until a out of memory exception is
received and then frees all blocks again. A MM must be robust towards this
kind of abuse with allocations of any block size. This function is modified
to use 160 kB blocks. Then we need 10 times fewer pointers. I recommend that
we add this function to make the validation even more thorough and the cost
of getting a longer running time for it.
function TMMValidation.Validate13x: Boolean;
var
Pointers : array[0..20000] of Pointer; // Modified
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
n : integer;
begin
n := 0;
try
repeat
//Allocate 160 kB pointer
GetMem(Pointers[n], 163840); //Modified
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
PChar(Pointers[n])[4] := 'A';
Inc(n);
until n > High(Pointers);
Result := True; // no exception at all, and using more than 3
GB...interesting !
except
on E: EOutOfMemory do // that's the right exception...
Result := True
else // all other exceptions are wrong...
Result := False;
end;
//Release memory
while n > 0 do
begin
Dec(n);
FreeMem(Pointers[n]);
end;
end;
Best regards
Dennis Kjaer Christensen
.
- References:
- FastCode MM B&V 0.55
- From: Bruce McGee
- FastCode MM B&V 0.55
- Prev by Date: Re: Webmaster - All Direct Calling Libraries is missing
- Next by Date: result double
- Previous by thread: Re: FastCode MM B&V 0.55
- Next by thread: Performance Bottlenecks
- Index(es):
Relevant Pages
|