summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew J. Schorr <aschorr@telemetry-investments.com>2017-01-26 11:30:20 -0500
committerAndrew J. Schorr <aschorr@telemetry-investments.com>2017-01-26 11:30:20 -0500
commita405df4fd26c1a1428fb3eb9d749c42295256634 (patch)
tree7de85c69167d53a3c35715744f27bca390d5ca55
parent6b12d4f726b9578d5c878fa765d5c167c9d71618 (diff)
downloadgawk-a405df4fd26c1a1428fb3eb9d749c42295256634.tar.gz
Minor tweak to block allocator to remove pointless BLOCK_INVALID header.
-rw-r--r--ChangeLog6
-rw-r--r--awk.h3
-rw-r--r--node.c1
3 files changed, 7 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index eb601525..62b956a9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-01-26 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * awk.h (enum block_id): Remove BLOCK_INVALID, since it serves no
+ useful purpose and seems to slow things down a bit.
+ * node.c (nextfree): Remove first invalid entry.
+
2017-01-25 Andrew J. Schorr <aschorr@telemetry-investments.com>
* awk.h (BLOCK): Remove typedef. BLOCK was used for 2 different
diff --git a/awk.h b/awk.h
index 66163519..199aba38 100644
--- a/awk.h
+++ b/awk.h
@@ -1060,8 +1060,7 @@ struct block_header {
};
enum block_id {
- BLOCK_INVALID = 0, /* not legal */
- BLOCK_NODE,
+ BLOCK_NODE = 0,
BLOCK_BUCKET,
BLOCK_MAX /* count */
};
diff --git a/node.c b/node.c
index f1f80177..d7ed98ea 100644
--- a/node.c
+++ b/node.c
@@ -1002,7 +1002,6 @@ void init_btowc_cache()
#define BLOCKCHUNK 100
struct block_header nextfree[BLOCK_MAX] = {
- { NULL, 0}, /* invalid */
{ NULL, sizeof(NODE) },
{ NULL, sizeof(BUCKET) },
};