Board index » delphi » Fastcode MM B&V 0.31

Fastcode MM B&V 0.31


2005-04-22 03:28:18 PM
delphi45
Hi
Let us start a todo list.
Best regards
Dennis
 
 

Re:Fastcode MM B&V 0.31

Quote
Let us start a todo list.
Fix
MemoryManager_Name = 'RecylerMM';
to
MemoryManager_Name = 'RecyclerMM';
;)
 

Re:Fastcode MM B&V 0.31

more MemUsage benchmarks.
very long running multithread validation to go under fastcode quality label
validation function that makes the rtl mm fail due to fragmentation.
regards
dennis
 

Re:Fastcode MM B&V 0.31

Set position to poScreenCenter
I'd love to see chart views for each benchmark (not all benchmarks all mms)
 

Re:Fastcode MM B&V 0.31

I would like to see a version of Recycler that passes validation.
regards
dennis
 

Re:Fastcode MM B&V 0.31

Quote
I would like to see a version of Recycler that passes validation.
Last posted version passes them here on single non-HT CPU :p
I've begun experimenting with alignment stuff and broken
everything in the process, not sure when I will have time to
look at it again... Though I guess I will focus on nailing that
cache issue for good first.
Eric
 

Re:Fastcode MM B&V 0.31

Hi
Fixed Cardinal cast to Integer cast. Old bug fix that failed to get released
function TMMValidation.Validate8 : Boolean;
var
I1, I2, I3, J1, J2 : Cardinal;
pMem : Pointer;
PointerArray : array[1..10] of Pointer;
MemoryStatus : TMemoryStatus;
const
BYTESTOALLOCATE : Cardinal = 2;//2 byte
begin
for I1 := 1 to Length(PointerArray) do
PointerArray[I1] := nil;
try
Result := True;
for I2 := 1 to Length(PointerArray) do
begin
GlobalMemoryStatus(MemoryStatus);
if MemoryStatus.dwAvailVirtual>= BYTESTOALLOCATE then
begin
//Allocate all pointers
GetMem(pMem, BYTESTOALLOCATE);
PointerArray[I2] := pMem;
end;
end;
for J1 := 1 to Length(PointerArray)-1 do
for J2 := J1+1 to Length(PointerArray) do
begin
//No pointers can overlap = be closer than BYTESTOALLOCATE
if Cardinal(Abs(Integer(PointerArray[J1]) - Integer(PointerArray[J2])))
< BYTESTOALLOCATE then
begin
Result := False;
Break;
end;
end;
//Free all pointers
for I3 := 1 to Length(PointerArray) do
begin
pMem := PointerArray[I3];
FreeMem(pMem);
PointerArray[I3] := nil;
end;
except
Result := False;
end;
end;
Regards
Dennis
 

Re:Fastcode MM B&V 0.31

One more
function TMMValidation.Validate9 : Boolean;
var
I1, I2, I3, J1, J2, BytesToAllocate : Cardinal;
pMem : Pointer;
PointerArray : array[1..2000] of Pointer;
MemoryStatus : TMemoryStatus;
const
BYTESTOALLOCATEMAX : Cardinal = 3000;//3000 byte
begin
Result := True;
try
for BytesToAllocate := 1 to BYTESTOALLOCATEMAX do
begin
for I1 := 1 to Length(PointerArray) do
PointerArray[I1] := nil;
for I2 := 1 to Length(PointerArray) do
begin
GlobalMemoryStatus(MemoryStatus);
if MemoryStatus.dwAvailVirtual>= BytesToAllocate then
begin
//Allocate all pointers
GetMem(pMem, BytesToAllocate);
PointerArray[I2] := pMem;
end;
end;
for J1 := 1 to Length(PointerArray)-1 do
for J2 := J1+1 to Length(PointerArray) do
begin
//No pointers can overlap = be closer than BytesToAllocate
if Cardinal(Abs(Integer(PointerArray[J1]) -
Integer(PointerArray[J2]))) < BytesToAllocate then
begin
Result := False;
Exit;
end;
end;
//Free all pointers
for I3 := 1 to Length(PointerArray) do
begin
pMem := PointerArray[I3];
FreeMem(pMem);
PointerArray[I3] := nil;
end;
end;
except
Result := False;
end;
end;
 

Re:Fastcode MM B&V 0.31

The last one
function TMMValidation.Validate7 : Boolean;
var
I1, I2, I3, J1, J2 : Cardinal;
pMem : Pointer;
PointerArray : array[1..10] of Pointer;
MemoryStatus : TMemoryStatus;
const
BYTESTOALLOCATE : Cardinal = 1;//1 byte
begin
for I1 := 1 to Length(PointerArray) do
PointerArray[I1] := nil;
try
Result := True;
for I2 := 1 to Length(PointerArray) do
begin
GlobalMemoryStatus(MemoryStatus);
if MemoryStatus.dwAvailVirtual>= BYTESTOALLOCATE then
begin
//Allocate all pointers
GetMem(pMem, BYTESTOALLOCATE);
PointerArray[I2] := pMem;
end;
end;
for J1 := 1 to Length(PointerArray)-1 do
for J2 := J1+1 to Length(PointerArray) do
begin
//No pointers can overlap = be closer than BYTESTOALLOCATE
if Cardinal(Abs(Integer(PointerArray[J1]) - Integer(PointerArray[J2])))
< BYTESTOALLOCATE then
begin
Result := False;
Break;
end;
end;
//Free all pointers
for I3 := 1 to Length(PointerArray) do
begin
pMem := PointerArray[I3];
FreeMem(pMem);
PointerArray[I3] := nil;
end;
except
Result := False;
end;
end;
 

Re:Fastcode MM B&V 0.31

I will make a release now with some of the issues on the todo list made.
Eric: Can you mail me the version of Recycler you want included?
Regards
Dennis
 

Re:Fastcode MM B&V 0.31

Released in attachments
Fixed/Done
3 validation functions: Cardinal casts changed to Integer
New DKC_IA32_MM
'RecyclerMM' correct name
Nexus disabled because it fails
Main form: Set position to poScreenCenter
Clean.bat included
Correct icon added
Version info fixed
Regards
Dennis