diff options
context:
space:
mode:
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Emit generated runs in batches, not a write each
Diffstat (limited to 'source/html.h')
-rw-r--r--source/html.h7
1 file changed, 7 insertions, 0 deletions
diff --git a/source/html.h b/source/html.h
index fa4de77..7572623 100644
--- a/source/html.h
+++ b/source/html.h
@@ -6,6 +6,13 @@
extern void html_raw(const char *txt, size_t size);
extern void html(const char *txt);
+/* How much of a generated run to build before handing it to html_raw. Batching
+ * is what removes the write per line, and html_raw already gathers what it is
+ * given into one buffer, so nothing is gained by growing past this. A run built
+ * whole would instead be sized by the file it was generated from, which the
+ * blob limits do not bound. */
+#define HTML_BATCH (64 * 1024)
+
__attribute__((format (printf,1,2)))
extern void htmlf(const char *format,...);