5.1.1 Allocation

All non-immediate objects are allocated in the “current allocation space,” which is dynamic space, static space, or read-only space. The current allocation space is initially dynamic space, but can be changed by using the Set-Allocation-Space miscop below. The current allocation space can be determined by using the Get-Allocation-Space miscop. One usually wants to change the allocation space around some section of code; an unwind protect should be used to insure that the allocation space is restored to some safe value.

Get-Allocation-Space ()

returns 0, 2, or 3 if the current allocation space is dynamic, static, or read-only, respectively.

Set-Allocation-Space (X)

sets the current allocation space to dynamic, static, or read-only if X is 0, 2, or 3 respectively. Returns X.

Alloc-Bit-Vector (Length)

returns a new bit-vector Length bits long, which is allocated in the current allocation space. Length must be a positive fixnum.

Alloc-I-Vector (Length A)

returns a new I-Vector Length bytes long, with the access code specified by A. Length and A must be positive fixnums.

Alloc-String (Length)

returns a new string Length characters long. Length must be a fixnum.

Alloc-Bignum (Length)

returns a new bignum Length 32-bit words long. Length must be a fixnum.

Make-Complex (Realpart Imagpart)

returns a new complex number with the specified Realpart and Imagpart. Realpart and Imagpart should be the same type of non-complex number.

Make-Ratio (Numerator Denominator)

returns a new ratio with the specified Numerator and Denominator. Numerator and Denominator should be integers.

Alloc-G-Vector (Length Initial-Element)

returns a new G-Vector with Length elements initialized to Initial-Element. Length should be a fixnum.

Static-G-Vector (Length Initial-Element)

returns a new G-Vector in static allocation space with Length elements initialized to Initial-Element.

Vector (Elt0 Elt1 ... EltLength - 1 Length)

returns a new G-Vector containing the specified Length elements. Length should be a fixnum and is passed in register A0. The rest of the arguments are passed on the stack.

Alloc-Function (Length)

returns a new function with Length elements. Length should be a fixnum.

Alloc-Array (Length)

returns a new array with Length elements. Length should be a fixnum.

Alloc-Symbol (Print-Name)

returns a new symbol with the print-name as Print-Name. The value is initially Trap, the definition is Trap, the property list and the package are initially NIL. The symbol is not interned by this operation – that is done in Lisp code. Print-Name should be a simple-string.

Cons (Car Cdr)

returns a new cons with the specified Car and Cdr.

List (Elt0 Elt1 ... EltCE - 1 Length)

returns a new list containing the Length elements. Length should be fixnum and is passed in register NL0. The first three arguments are passed in A0, A1, and A2. The rest of the arguments are passed on the stack.

List* (Elt0 Elt1 ... EltCE - 1 Length)

returns a list* formed by the Length-1 elements. The last element is placed in the cdr of the last element of the new list formed. Length should be a fixnum and is passed in register NL0. The first three arguments are passed in A0, A1, and A2. The rest of the arguments are passed on the stack.

MV-List (Elt<0> Elt<1> ... Elt<CE - 1> Length)

returns a list formed from the elements, all of which are on the stack. Length is passed in register A0. This miscop is invoked when multiple values from a function call are formed into a list.