raz / test / run / VecFull.raz

15 lines · 422 B · raw · history · last change 264716cb

1module VecFull;
2(* a Vec whose allocator runs out stops the program, with the calls
3 under way, rather than dropping what it was given *)
4import Arena, Rt, Ints := Vec(INT);
5import SYSTEM;
6
7proc main*;
8var ar: Arena.Arena; v: Ints.Vec; i: INT;
9begin
10 if not Arena.init(ar, 4096) then Rt.stop("no arena"); end;
11 Ints.init(v, SYSTEM.ADR(ar.base));
12 for i := 1 to 10000 do Ints.push(v, i); end;
13end;
14
15end VecFull.