From 0c73a05dca8afca491298f3d8f07750e3fcf330d Mon Sep 17 00:00:00 2001 From: Vicent Marti Date: Mon, 30 May 2016 15:49:14 +0200 Subject: node: Memory diet Save node information in flags instead of using one boolean for each property. --- src/node.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/node.h') 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; -- cgit v1.2.3