-- JaMStorageImpl.mesa -- Pilot version -- Last changed by Doug Wyatt, 13-Oct-81 17:33:49 -- Last changed by Bill Paxton, March 18, 1982 12:13 pm DIRECTORY JaMStorage USING [TextObject], UnsafeStorage USING [TrimUZone, NewUZone], Inline USING [LongCOPY]; JaMStorageImpl: PROGRAM IMPORTS UnsafeStorage, Inline EXPORTS JaMStorage SHARES JaMStorage = { zone: UNCOUNTED ZONE = UnsafeStorage.NewUZone[]; Zone: PUBLIC PROC RETURNS[UNCOUNTED ZONE] = { RETURN[zone] }; pruning: BOOLEAN _ FALSE; -- can turn this on someday Prune: PUBLIC PROC = { IF pruning THEN UnsafeStorage.TrimUZone[zone] }; -- Text allocation TextObject: TYPE = JaMStorage.TextObject; PrivateTextPut: PUBLIC PROC[t: POINTER TO TextObject, c: CHARACTER] = { old: LONG STRING _ t.text; new: LONG STRING _ NIL; length: CARDINAL _ t.len; oldmax: CARDINAL _ t.max; maxmax: CARDINAL = t.lim; newmax: CARDINAL _ oldmax + MIN[oldmax/2,maxmax-oldmax]; IF NOT length