diff options
author | John MacFarlane <jgm@berkeley.edu> | 2015-02-18 15:49:45 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2015-02-18 15:49:45 -0800 |
commit | 5e90436d9c90d6e8e5612cebb4266eea432168b4 (patch) | |
tree | a72f96b38e78088f79d278b73d04109072948275 /src | |
parent | 0f90fc3f7ec06dd032ab28ef0478c415f831862f (diff) |
Packed cmark_node struct to fit into 128 bytes.
This gives a small performance boost (0.37 to 0.36).
Diffstat (limited to 'src')
-rw-r--r-- | src/node.h | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -6,6 +6,7 @@ extern "C" { #endif #include <stdio.h> +#include <stdint.h> #include "cmark.h" #include "buffer.h" @@ -22,12 +23,13 @@ typedef struct { } cmark_list; typedef struct { - bool fenced; - int fence_length; - int fence_offset; - unsigned char fence_char; cmark_chunk info; cmark_chunk literal; + int fence_length; + /* fence_offset must be 0-3, so we can use int8_t */ + int8_t fence_offset; + unsigned char fence_char; + bool fenced; } cmark_code; typedef struct { @@ -41,8 +43,6 @@ typedef struct { } cmark_link; struct cmark_node { - cmark_node_type type; - struct cmark_node *next; struct cmark_node *prev; struct cmark_node *parent; @@ -55,6 +55,9 @@ struct cmark_node { int start_column; int end_line; int end_column; + + cmark_node_type type; + bool open; bool last_line_blank; |