Handbook
Glossary
pile-alloc ( pile size -- alien )
Piles
Prev:
<pile> ( size -- pile )
Next:
<pile-c-array> ( pile n c-type -- alien )
Vocabulary
memory
.
piles
Inputs
pile
a
pile
size
an
integer
Outputs
alien
an
alien
Word description
Requests
size
bytes from a
pile
. If the pile does not have enough space to satisfy the request, a
not-enough-pile-space
error is thrown.
Definition
USING:
accessors
alien
kernel
math
;
IN:
memory.piles
:
pile-alloc
( pile size -- alien )
[
[
[
]
[
size>>
]
[
offset>>
]
tri
]
dip
+
<
[
not-enough-pile-space
]
[
drop
]
if
]
[
drop
[
offset>>
]
[
underlying>>
]
bi
<displaced-alien>
]
[
[
+
]
curry
change-offset
drop
]
2tri
;