summaryrefslogtreecommitdiff
path: root/gawkapi.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2016-11-12 19:12:13 +0200
committerArnold D. Robbins <arnold@skeeve.com>2016-11-12 19:12:13 +0200
commitcc04afb329cea035d0d9b67cd3b677e06b2f3996 (patch)
tree3622f3f241d75079bcafd24651a4952e357a9c09 /gawkapi.c
parent9a31c12053ef715ccb732f456de00b4afc38d888 (diff)
downloadgawk-feature/nocopy.tar.gz
Further code improvements and doc changes as diff until merge.feature/nocopy
Diffstat (limited to 'gawkapi.c')
-rw-r--r--gawkapi.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gawkapi.c b/gawkapi.c
index 7bba07f6..958c3c16 100644
--- a/gawkapi.c
+++ b/gawkapi.c
@@ -396,6 +396,8 @@ static struct {
size_t i, size;
} scopy;
+/* free_api_string_copies --- release memory used by string copies */
+
void
free_api_string_copies()
{
@@ -406,7 +408,7 @@ free_api_string_copies()
scopy.i = 0;
}
-/* return a node string with nul termination */
+/* assign_string --- return a string node with NUL termination */
static inline void
assign_string(NODE *node, awk_value_t *val)
@@ -418,6 +420,7 @@ assign_string(NODE *node, awk_value_t *val)
* This should happen only for $n where n > 0 and n < NF.
*/
char *s;
+
assert((node->flags & MALLOC) == 0);
if (scopy.i == scopy.size) {
/* expand list */