aboutsummaryrefslogtreecommitdiffstats
path: root/src/outputBuffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/outputBuffer.c')
-rw-r--r--src/outputBuffer.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/outputBuffer.c b/src/outputBuffer.c
index 6732d0e7a..b0cfc00df 100644
--- a/src/outputBuffer.c
+++ b/src/outputBuffer.c
@@ -31,6 +31,7 @@ void ob_init(unsigned int size)
ob.size = size;
ob.begin = 0;
ob.end = 0;
+ ob.lazy = 0;
ob.chunks[0].chunkSize = 0;
}
@@ -61,7 +62,7 @@ static inline unsigned successor(unsigned i)
*/
static void output_buffer_expand(unsigned i)
{
- int was_empty = ob_is_empty();
+ int was_empty = !ob.lazy || ob_is_empty();
assert(i == (ob.end + 1) % ob.size);
assert(i != ob.end);
@@ -91,6 +92,11 @@ void ob_flush(void)
}
}
+void ob_set_lazy(int lazy)
+{
+ ob.lazy = lazy;
+}
+
int ob_is_empty(void)
{
return ob.begin == ob.end;