--m.stone May 12, 1979 4:37 PM --SplineMemoryFns DIRECTORY SplineMemoryDefs: FROM "SplineMemoryDefs", SplineDefs: FROM "SplineDefs"; SplineMemoryFns: PROGRAM EXPORTS SplineMemoryDefs,SplineDefs = BEGIN thisAllocate: PROCEDURE[nwords: CARDINAL] RETURNS[POINTER] ← NoAlloc; thisFree: PUBLIC PROCEDURE[ptr: POINTER TO UNSPECIFIED] ← NoFree; NoInitSplines: PUBLIC SIGNAL = CODE; Allocate: PUBLIC PROCEDURE[nwords: CARDINAL] RETURNS[POINTER] = BEGIN RETURN[thisAllocate[nwords]]; END; Free: PUBLIC PROCEDURE[ptr: POINTER TO UNSPECIFIED] = BEGIN thisFree[ptr]; END; NoAlloc: PROCEDURE[nwords: CARDINAL] RETURNS[POINTER] = BEGIN SIGNAL NoInitSplines; RETURN[NIL]; END; NoFree: PROCEDURE[ptr: POINTER TO UNSPECIFIED] = BEGIN SIGNAL NoInitSplines; END; InitSplines: PUBLIC PROCEDURE[ alloc: PROCEDURE[nwords: CARDINAL] RETURNS[POINTER], free: PROCEDURE[POINTER TO UNSPECIFIED]] = BEGIN thisAllocate ← alloc; thisFree ← free; END; FreeCoeffs: PUBLIC PROCEDURE[coeffs: DESCRIPTOR FOR ARRAY OF SplineDefs.Coeffs] = BEGIN Free[BASE[coeffs]]; END; END.