-
-
Notifications
You must be signed in to change notification settings - Fork 554
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rework node struct #326
Rework node struct #326
Commits on Jan 23, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 990bd94 - Browse repository at this point
Copy the full SHA 990bd94View commit details -
Use C string instead of chunk for code info and literal
Use zero-terminated C strings instead of cmark_chunks without storing the length. The length of code literals will be readded in a later commit. strlen overhead for code info should be negligible. Reduces size of struct cmark_node by 8 bytes.
Configuration menu - View commit details
-
Copy full SHA for 150ef76 - Browse repository at this point
Copy the full SHA 150ef76View commit details -
Use C string instead of chunk for link URL and title
Use zero-terminated C strings instead of cmark_chunks without storing the length. This introduces a few additional strlen computations, but overhead should be low. Allows to reduce size of struct cmark_node later.
Configuration menu - View commit details
-
Copy full SHA for d52d52f - Browse repository at this point
Copy the full SHA d52d52fView commit details -
Use C string instead of chunk for custom block contents
Reduces size of struct cmark_node by 8 bytes.
Configuration menu - View commit details
-
Copy full SHA for accc7e9 - Browse repository at this point
Copy the full SHA accc7e9View commit details -
Use C string instead of chunk for literal text
Use zero-terminated C strings and a separate length field instead of cmark_chunks. Literal inline text will now be copied from the parent block's content buffer, slowing the benchmark down by 10-15%. The node struct never references memory of other nodes now, fixing commonmark#309. Node accessors don't have to check for delayed creation of C strings, so parsing and iterating all literals using the public API should actually be faster than before.
Configuration menu - View commit details
-
Copy full SHA for d994960 - Browse repository at this point
Copy the full SHA d994960View commit details -
Use C string instead of chunk in renderer
Fix another place where an "allocated" cmark_chunk was used.
Configuration menu - View commit details
-
Copy full SHA for 0f61fdb - Browse repository at this point
Copy the full SHA 0f61fdbView commit details -
Improve packing of struct cmark_list
Allows to reduce size of struct cmark_node later.
Configuration menu - View commit details
-
Copy full SHA for 5bb0931 - Browse repository at this point
Copy the full SHA 5bb0931View commit details -
Introduce multi-purpose data/len members in struct cmark_node. This is mainly used to store literal text for inlines, code and HTML blocks. Move the content strbuf for blocks from cmark_node to cmark_parser. When finalizing nodes that allow inlines (paragraphs and headings), detach the strbuf and store the block content in the node's data/len members. Free the block content after processing inlines. Reduces size of struct cmark_node by 8 bytes.
Configuration menu - View commit details
-
Copy full SHA for 30c3095 - Browse repository at this point
Copy the full SHA 30c3095View commit details