|
@@ -1298,7 +1298,7 @@ END NewProtRec;
|
|
|
|
|
|
|
|
|
|
(** NewArr - Implementation of NEW with an array containing pointers. *)
|
|
(** NewArr - Implementation of NEW with an array containing pointers. *)
|
|
-PROCEDURE NewArr*(VAR p: ANY; elemTag: ADDRESS; numElems, numDims: SIZE; isRealtime: BOOLEAN);
|
|
|
|
|
|
+PROCEDURE NewArr*(VAR p: ANY; elemTag: ADDRESS; numElems, numDims: SIZE; isRealtime: BOOLEAN);
|
|
VAR arrayBlockAdr, dataBlockAdr: ADDRESS;
|
|
VAR arrayBlockAdr, dataBlockAdr: ADDRESS;
|
|
elemSize, arrSize, blockSize, arrayBlockSize, fillSize, size, arrayDataOffset: SIZE;
|
|
elemSize, arrSize, blockSize, arrayBlockSize, fillSize, size, arrayDataOffset: SIZE;
|
|
firstElem: ADDRESS;
|
|
firstElem: ADDRESS;
|
|
@@ -1377,7 +1377,7 @@ UnsafeArrayDesc = RECORD (ArrayDataBlockDesc)
|
|
END;
|
|
END;
|
|
|
|
|
|
(* replacement for overcomplicated code emission -- at the cost of a slightly increased runtime cost *)
|
|
(* replacement for overcomplicated code emission -- at the cost of a slightly increased runtime cost *)
|
|
-PROCEDURE NewArray*(CONST a: ARRAY OF SIZE; elementSize: SIZE; tag: ADDRESS; VAR dest: ANY);
|
|
|
|
|
|
+PROCEDURE NewArray*(CONST a: ARRAY OF SIZE; tag: ADDRESS; staticElements, elementSize: SIZE; VAR dest: ANY);
|
|
VAR p: ANY; dim: SIZE;
|
|
VAR p: ANY; dim: SIZE;
|
|
|
|
|
|
PROCEDURE GetSize(): SIZE;
|
|
PROCEDURE GetSize(): SIZE;
|
|
@@ -1387,18 +1387,19 @@ VAR p: ANY; dim: SIZE;
|
|
FOR i := 0 TO dim-1 DO
|
|
FOR i := 0 TO dim-1 DO
|
|
size := size * a[i];
|
|
size := size * a[i];
|
|
END;
|
|
END;
|
|
- RETURN size;
|
|
|
|
|
|
+ RETURN size*staticElements;
|
|
END GetSize;
|
|
END GetSize;
|
|
|
|
|
|
PROCEDURE SetSizes(dest: UnsafeArray);
|
|
PROCEDURE SetSizes(dest: UnsafeArray);
|
|
VAR i: SIZE;
|
|
VAR i: SIZE;
|
|
BEGIN
|
|
BEGIN
|
|
FOR i := 0 TO dim-1 DO
|
|
FOR i := 0 TO dim-1 DO
|
|
- dest.len[i] := a[i];
|
|
|
|
|
|
+ dest.len[i] := a[dim-1-i];
|
|
END;
|
|
END;
|
|
END SetSizes;
|
|
END SetSizes;
|
|
|
|
|
|
BEGIN
|
|
BEGIN
|
|
|
|
+ (* static elements is requred for this case : POINTER TO ARRAY OF ARRAY X OF RecordWithPointer *)
|
|
dim := LEN( a,0 );
|
|
dim := LEN( a,0 );
|
|
IF tag = NIL THEN
|
|
IF tag = NIL THEN
|
|
NewSys(p, GetSize() * elementSize + dim * SIZEOF(ADDRESS) + 3 *SIZEOF(ADDRESS) + (dim DIV 2) * 2 * SIZEOF(ADDRESS), FALSE);
|
|
NewSys(p, GetSize() * elementSize + dim * SIZEOF(ADDRESS) + 3 *SIZEOF(ADDRESS) + (dim DIV 2) * 2 * SIZEOF(ADDRESS), FALSE);
|
|
@@ -1620,7 +1621,7 @@ TraceHeap:
|
|
*)
|
|
*)
|
|
|
|
|
|
Compiler.Compile -p=Win32G --traceModule=Trace Heaps.Mod ~
|
|
Compiler.Compile -p=Win32G --traceModule=Trace Heaps.Mod ~
|
|
-StaticLinker.Link --fileFormat=PE32 --fileName=A2P.exe --extension=GofW --displacement=401000H Runtime Trace Kernel32 Machine Heaps Modules Objects Kernel KernelLog Streams Commands FIles WinFS Clock Dates Reals Strings Diagnostics BitSets StringPool ObjectFile GenericLinker Reflection GenericLoader BootConsole ~
|
|
|
|
|
|
+StaticLinker.Link --fileFormat=PE32 --fileName=A2.exe --extension=GofW --displacement=401000H Runtime Trace Kernel32 Machine Heaps Modules Objects Kernel KernelLog Streams Commands FIles WinFS Clock Dates Reals Strings Diagnostics BitSets StringPool ObjectFile GenericLinker Reflection GenericLoader BootConsole ~
|
|
FSTools.CloseFiles A2M.exe ~
|
|
FSTools.CloseFiles A2M.exe ~
|
|
|
|
|
|
|
|
|