Hey,
I have written following Code, to improve memcpy() Speed and when i debug and jump in the functions it prints me, that the passed start-address is Nil and so the whole Array ?
Can u have a look pls
class method fast_memcopy(dst: ^void; const src: ^void; const size: UInt32);
begin
var dst32: ^byte32_align := ^byte32_align(dst);
var src32: ^byte32_align := ^byte32_align(dst);
var count32: UInt64 := size div sizeof(byte32_align);
var rest32: UInt64 := size mod sizeof(byte32_align);
for x: UInt64 := count32 downto 0 do
begin
dst32^ := src32^;
inc(dst32);
inc(src32);
end;
var dst1 : ^Byte := ^Byte(dst32);
var src1 : ^Byte := ^Byte(src32);
for x: UInt64 := rest32 downto 0 do
begin
dst1^ := src1^;
inc(dst1);
inc(src1);
end;
end;
and i pass a start-adress of dst and src!
writeLn('Start = ' + DateTime.Now.ToString());
var size := 4096;
var dst := new array of Double(size * size);
var src := new array of Double(size * size);
for i : Int32 := 0 to src.Length -1 do
begin
src[i] := size * 0.3;
end;
fast_memcopy(@dst[0], @src[0], src.Length * sizeOf(Double));
//β> src and dst are nil