@@ -115,6 +115,27 @@ typedef struct cmark_mem {
115115Defines the memory allocation functions to be used by CMark when parsing
116116and allocating a document tree
117117
118+ .PP
119+ \fI cmark_mem * \f[ ] \fB cmark_get_default_mem_allocator \f[ ] (\fI \f[ ] )
120+
121+ .PP
122+ The default memory allocator; uses the system's calloc, realloc and
123+ free.
124+
125+ .PP
126+ \fI cmark_mem * \f[ ] \fB cmark_get_arena_mem_allocator \f[ ] (\fI \f[ ] )
127+
128+ .PP
129+ An arena allocator; uses system calloc to allocate large slabs of
130+ memory. Memory in these slabs is not reused at all.
131+
132+ .PP
133+ \fI void \f[ ] \fB cmark_arena_reset \f[ ] (\fI void \f[ ] )
134+
135+ .PP
136+ Resets the arena allocator, quickly returning all used memory to the
137+ operating system.
138+
118139.SS
119140Creating and Destroying Nodes
120141
@@ -646,6 +667,13 @@ Rendering
646667Render a \f[I] node \f[ ] tree as XML. It is the caller's responsibility to
647668free the returned buffer.
648669
670+ .PP
671+ \fI char * \f[ ] \fB cmark_render_xml_with_mem \f[ ] (\fI cmark_node *root \f[ ] , \fI int options \f[ ] , \fI cmark_mem *mem \f[ ] )
672+
673+ .PP
674+ As for \f[I] cmark_render_xml \f[ ] , but specifying the allocator to use
675+ for the resulting string.
676+
649677.PP
650678\fI char * \f[ ] \fB cmark_render_html \f[ ] (\fI cmark_node *root \f[ ] , \fI int options \f[ ] )
651679
@@ -654,27 +682,55 @@ Render a \f[I]node\f[] tree as an HTML fragment. It is up to the user to
654682add an appropriate header and footer. It is the caller's responsibility
655683to free the returned buffer.
656684
685+ .PP
686+ \fI char * \f[ ] \fB cmark_render_html_with_mem \f[ ] (\fI cmark_node *root \f[ ] , \fI int options \f[ ] , \fI cmark_mem *mem \f[ ] )
687+
688+ .PP
689+ As for \f[I] cmark_render_html \f[ ] , but specifying the allocator to use
690+ for the resulting string.
691+
657692.PP
658693\fI char * \f[ ] \fB cmark_render_man \f[ ] (\fI cmark_node *root \f[ ] , \fI int options \f[ ] , \fI int width \f[ ] )
659694
660695.PP
661696Render a \f[I] node \f[ ] tree as a groff man page, without the header. It
662697is the caller's responsibility to free the returned buffer.
663698
699+ .PP
700+ \fI char * \f[ ] \fB cmark_render_man_with_mem \f[ ] (\fI cmark_node *root \f[ ] , \fI int options \f[ ] , \fI int width \f[ ] , \fI cmark_mem *mem \f[ ] )
701+
702+ .PP
703+ As for \f[I] cmark_render_man \f[ ] , but specifying the allocator to use
704+ for the resulting string.
705+
664706.PP
665707\fI char * \f[ ] \fB cmark_render_commonmark \f[ ] (\fI cmark_node *root \f[ ] , \fI int options \f[ ] , \fI int width \f[ ] )
666708
667709.PP
668710Render a \f[I] node \f[ ] tree as a commonmark document. It is the caller's
669711responsibility to free the returned buffer.
670712
713+ .PP
714+ \fI char * \f[ ] \fB cmark_render_commonmark_with_mem \f[ ] (\fI cmark_node *root \f[ ] , \fI int options \f[ ] , \fI int width \f[ ] , \fI cmark_mem *mem \f[ ] )
715+
716+ .PP
717+ As for \f[I] cmark_render_commonmark \f[ ] , but specifying the allocator to
718+ use for the resulting string.
719+
671720.PP
672721\fI char * \f[ ] \fB cmark_render_latex \f[ ] (\fI cmark_node *root \f[ ] , \fI int options \f[ ] , \fI int width \f[ ] )
673722
674723.PP
675724Render a \f[I] node \f[ ] tree as a LaTeX document. It is the caller's
676725responsibility to free the returned buffer.
677726
727+ .PP
728+ \fI char * \f[ ] \fB cmark_render_latex_with_mem \f[ ] (\fI cmark_node *root \f[ ] , \fI int options \f[ ] , \fI int width \f[ ] , \fI cmark_mem *mem \f[ ] )
729+
730+ .PP
731+ As for \f[I] cmark_render_latex \f[ ] , but specifying the allocator to use
732+ for the resulting string.
733+
678734.SS
679735Options
680736
0 commit comments