Re: Fastcode MM B&V 0.34
- From: "Dennis" <marianndkc@xxxxxxxxxxxxxxx>
- Date: Sat, 30 Apr 2005 15:35:40 +0200
Hi All & Pierre
I just made this simple realloc validation to test my own super MM.
It reallocs from a small size to a big one and down again and veryfies
that
data in the low part are preserved.
FastMM3 failed.
Somebody could volunteer to enhance it to test many more different sized
reallocs.
function TMMValidation.Validate21 : Boolean;
var
SomeArray : array of Byte;
MemoryStatus : TMemoryStatus;
BytesToAllocate, I1, I2, I3, StartAddress : Cardinal;
const
BYTESTOALLOCATEMIN : Cardinal = 1024;//1 Kbyte
BYTESTOALLOCATEMAX : Cardinal = 1024*1024;//1 Mbyte
FILLBYTE : Byte = 224;
begin
GlobalMemoryStatus(MemoryStatus);
try
if MemoryStatus.dwAvailVirtual >= BYTESTOALLOCATEMAX then
begin
SetLength(SomeArray, BYTESTOALLOCATEMIN);
for I1 := 0 to BYTESTOALLOCATEMIN-1 do
SomeArray[I1] := FILLBYTE;
SetLength(SomeArray, BYTESTOALLOCATEMAX);
for I2 := 0 to BYTESTOALLOCATEMIN-1 do
begin
if SomeArray[I2] <> FILLBYTE then
begin
Result := False;
Exit;
end;
end;
SetLength(SomeArray, BYTESTOALLOCATEMIN);
for I3 := 0 to BYTESTOALLOCATEMIN-1 do
begin
if SomeArray[I3] <> FILLBYTE then
begin
Result := False;
Exit;
end;
end;
end;
except
Result := False;
end;
end;
Regards
Dennis
--
Jeg beskyttes af den gratis SPAMfighter til privatbrugere.
Den har indtil videre sparet mig for at få 75 spam-mails.
Betalende brugere får ikke denne besked i deres e-mails.
Hent den gratis her: www.spamfighter.dk
.
- Follow-Ups:
- Re: Fastcode MM B&V 0.34
- From: Pierre le Riche
- Re: Fastcode MM B&V 0.34
- References:
- Fastcode MM B&V 0.34
- From: Dennis
- Fastcode MM B&V 0.34
- Prev by Date: Re: String Functions
- Next by Date: Re: String Functions
- Previous by thread: Re: Fastcode MM B&V 0.34
- Next by thread: Re: Fastcode MM B&V 0.34
- Index(es):