1 // stdio.asm: WORD p_unstream,'UNSTREAM',fasm
7 Data stack: ( stream* -- )
10 "UNSTREAM" is a function word that releases the memory allocated for a
11 stream, and closes the associated file if it's a file stream.
13 ==== File descriptor backed stream
15 This kind of stream has the stream header as a prefix within the
16 allocated memory. Thus, stream* is the base address for the memory to
17 reclaim, and the size of this is determined from the cell at (stream*
18 + 16) plus the 32 bytes head itself.
20 ==== Memory block backed STREAM
22 This kind of stream has a separate header which points at the memory
23 area to reclaim. The cell at stream* is the base address, and the cell
24 at (stream* + 16) is its size.