summary refs log tree commit diff
path: root/dynamic.e
diff options
context:
space:
mode:
Diffstat (limited to 'dynamic.e')
-rw-r--r--dynamic.e9
1 files changed, 9 insertions, 0 deletions
diff --git a/dynamic.e b/dynamic.e
index a02eec0..af5d9b2 100644
--- a/dynamic.e
+++ b/dynamic.e
@@ -348,6 +348,15 @@
   3roll + 8 packalign here ! ;
 
 
+~   Takes a string pointer which must be equal to the current value of "here",
+~ indicating it is in the temporary allocation space, and allocates it
+~ permanently by advancing "here" to the next aligned address after it.
+~
+~ (string pointer -- string pointer)
+: allocate-string
+  dup dup stringlen 1+ + 8 packalign here ! ;
+
+
 ~   Allocate space by incrementing "here", and output a word entry header in
 ~ it. Also add it to the "latest" linked list. Use zero as the flag values;
 ~ accept a string pointer on the stack and use its contents as the name.