aboutsummaryrefslogtreecommitdiff
path: root/sys/symtab/stsqueeze.x
diff options
context:
space:
mode:
Diffstat (limited to 'sys/symtab/stsqueeze.x')
-rw-r--r--sys/symtab/stsqueeze.x25
1 files changed, 25 insertions, 0 deletions
diff --git a/sys/symtab/stsqueeze.x b/sys/symtab/stsqueeze.x
new file mode 100644
index 00000000..47f7b227
--- /dev/null
+++ b/sys/symtab/stsqueeze.x
@@ -0,0 +1,25 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include "symtab.h"
+
+# STSQUEEZE -- Return any unused storage in a symbol table. This is useful
+# when it is known that no more symbols will be entered in a table, or before
+# saving a symbol table in a save file.
+
+procedure stsqueeze (stp)
+
+pointer stp # symtab descriptor
+
+begin
+ if (ST_STABLEN(stp) > ST_STABOP(stp)) {
+ ST_STABLEN(stp) = ST_STABOP(stp)
+ ST_STABINC(stp) = min (MAX_INCREMENT, ST_STABLEN(stp))
+ call realloc (ST_STABP(stp), ST_STABLEN(stp), TY_STRUCT)
+ }
+
+ if (ST_SBUFLEN(stp) > ST_SBUFOP(stp)) {
+ ST_SBUFLEN(stp) = ST_SBUFOP(stp)
+ ST_SBUFINC(stp) = min (MAX_INCREMENT, ST_SBUFLEN(stp))
+ call realloc (ST_SBUFP(stp), ST_SBUFLEN(stp), TY_CHAR)
+ }
+end