summaryrefslogtreecommitdiff
path: root/src/node.h
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2016-05-30 15:49:14 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2016-06-06 15:39:05 -0700
commit0c73a05dca8afca491298f3d8f07750e3fcf330d (patch)
treeea30124002b35c0660bdb56d07422e0669d17f2e /src/node.h
parent25429c96f6554ffac415f9d865934b1183f3398e (diff)
node: Memory diet
Save node information in flags instead of using one boolean for each property.
Diffstat (limited to 'src/node.h')
-rw-r--r--src/node.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/node.h b/src/node.h
index 1fff990..84b2560 100644
--- a/src/node.h
+++ b/src/node.h
@@ -47,6 +47,11 @@ typedef struct {
cmark_chunk on_exit;
} cmark_custom;
+enum cmark_node__internal_flags {
+ CMARK_NODE__OPEN = (1 << 0),
+ CMARK_NODE__LAST_LINE_BLANK = (1 << 1),
+};
+
struct cmark_node {
cmark_strbuf content;
@@ -62,10 +67,8 @@ struct cmark_node {
int start_column;
int end_line;
int end_column;
-
- cmark_node_type type;
- bool last_line_blank;
- bool open;
+ uint16_t type;
+ uint16_t flags;
union {
cmark_chunk literal;