raz / test / run / BufFull.raz

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

1module BufFull;
2(* a Buf whose allocator runs out stops the program, with the calls
3 under way, rather than dropping what it was given *)
4import Buf, Arena, Rt;
5import SYSTEM;
6
7proc main*;
8var ar: Arena.Arena; b: Buf.Buf; big: [10000]U8;
9begin
10 if not Arena.init(ar, 4096) then Rt.stop("no arena"); end;
11 Buf.init(b, SYSTEM.ADR(ar.base));
12 Buf.str(b, big);
13end;
14
15end BufFull.