The CompareMemory always gives 0 by #VAL greater than 600.
I'm not sure if this is a bug or I'm doing something wrong.
Code: Select all
EnableExplicit
Define g
#VAL=4000
Procedure _Code_MemoryDecodeSingleExt(*mem,size,seed.q)
Protected.q i
For i=0 To (size-1):PokeA(*mem+i,PeekA(*mem+i)-seed):Next
EndProcedure
Define *mem=AllocateMemory(#VAL)
Define *mem2=AllocateMemory(#VAL)
Define start=ElapsedMilliseconds()
For g=0 To 10
_Code_MemoryDecodeSingleExt(*mem,#VAL,g)
Next
Define ende=ElapsedMilliseconds()
Structure seed
seed.i
tt.i
thread.i
*mem
EndStructure
Procedure rThread(*data.seed)
_Code_MemoryDecodeSingleExt(*data\mem,#VAL,*data\seed)
EndProcedure
NewList tt.seed()
Define start2=ElapsedMilliseconds()
For g=0 To 10
Define *t.seed=AddElement(tt())
*t\seed=g
*t\mem=*mem2
*t\thread=CreateThread(@rThread(),*t)
Next
ForEach tt()
If IsThread(tt()\thread)
WaitThread(tt()\thread)
EndIf
Next
Define ende2=ElapsedMilliseconds()
Debug "Normal: "+Str(ende-start)
Debug "Thread: "+Str(ende2-start2)
Debug CompareMemory(*mem,*mem2,#VAL)