; ; mem.sh ; ; Generic memory allocation for TermScript ; ; © 1995 Straylight ; ;----- Overview ------------------------------------------------------------- ; ; Functions provided: ; ; mem_alloc ; mem_free ; mem_realloc [ :LNOT::DEF:mem__dfn GBLL mem__dfn ; --- mem_alloc --- ; ; On entry: R0 == size of block to allocate ; ; On exit: R0 == pointer to anchor for that block ; May return an error ; ; Use: Tries to allocate a block of memory, and returns a pointer ; to the anchor for that block. All very unusual really, ; but we blame Wimp_Extension which allocates anchors for ; you in an utterley horrible way. IMPORT mem_alloc ; --- mem_free --- ; ; On entry: R0 == anchor of the block to free ; ; On exit: -- ; ; Use: Frees the block. IMPORT mem_free ; --- mem_realloc --- ; ; On entry: R0 == pointer to block anchor ; R1 == new size requested ; ; On exit: May return an error ; ; Use: Resizes a block IMPORT mem_realloc ] ;----- That's all, folks ---------------------------------------------------- END