Allocation of dynamic open arrays using NEW(p, len)
29 Aug
2018
29 Aug
'18
4:46 p.m.
An enhanced FPGA Oberon 2013 compiler is now available at: https://github.com/andreaspirklbauer/Oberon-enhanced-FPGA-Oberon07-compiler Among other things it contains a dynamic heap allocation procedure NEW(p, len) for open arrays: MODULE Test; TYPE Record = RECORD a, b: INTEGER END ; Array1 = ARRAY OF Record; (*open array*) Array2 = ARRAY 20 OF Record; (*fixed-length array*) Pointer1 = POINTER TO Array1; Pointer2 = POINTER TO Array2; VAR a1: Pointer1; a2: Pointer2; PROCEDURE New1*; BEGIN NEW(a1, 100); a1[53].b := 7 END New1; PROCEDURE New2*; BEGIN NEW(a2); a2[3].b := 7 END New2; END Test. ORP.Compile Test.Mod/s ~ Test.New1 Test.New2
3011
Age (days ago)
3011
Last active (days ago)
0 comments
1 participants
participants (1)
-
Andreas Pirklbauer