focus expression text field at startup -> version 1.2
[LeanCalc.git] / help / blkfree
1 NAME
2     blkfree - free memory allocated to named block
3
4 SYNOPSIS
5     blkfree(val)
6
7 TYPES
8     val         named block, string, or integer
9
10     return      null value
11
12 DESCRIPTION
13     If val is a named block, or the name of a named block, or the
14     identifying index for a named block, blkfree(val) frees the
15     memory block allocated to this named block.  The block remains
16     in existence with the same name, identifying index, and chunksize,
17     but its size and maxsize becomes zero and the pointer for the start
18     of its data block null.
19
20     A new block of memory may be allocated to a freed block B by
21     blk(B [, len, chunk]), len defaulting to zero and chunk to the
22     chunksize when the block was freed.
23
24 EXAMPLE
25
26     > B1 = blk("foo")
27     > B2 = blk("Second block")
28     show blocks
29      id   name
30     ----  -----
31      0   foo
32      1   Second block
33
34     > blkfree(B1)
35     > show blocks
36      id   name
37     ----  -----
38      1   Second block
39
40     > B1
41         block 0: foo
42         chunksize = 256, maxsize = 0, datalen = 0
43         NULL
44
45     > blk(B1); B[7] = 5
46     > B1
47         block 0: foo
48         chunksize = 256, maxsize = 256, datalen = 8
49         0000000000000005
50
51 LIMITS
52     none
53
54 LINK LIBRARY
55     none
56
57 SEE ALSO
58     blk, blocks
59