mirror of
https://github.com/matrix-construct/construct
synced 2024-11-18 07:50:57 +01:00
ircd::json::stack::checkpoint: Trigger unforced flush from checkpoint dtor.
This commit is contained in:
parent
2b6b69658b
commit
777ea844e7
1 changed files with 8 additions and 0 deletions
|
@ -1741,6 +1741,14 @@ noexcept
|
||||||
|
|
||||||
assert(s->cp == this);
|
assert(s->cp == this);
|
||||||
s->cp = pc;
|
s->cp = pc;
|
||||||
|
|
||||||
|
// Certain uses of json::stack in loops might create and destroy
|
||||||
|
// checkpoints without any appends between their lifetimes. This results
|
||||||
|
// in the buffer filling up and inevitably force-flushing under an unlucky
|
||||||
|
// checkpoint (which is bad). This non-forced flush here prevents that once
|
||||||
|
// the buffer reaches the low-watermark and there is no parent checkpoint.
|
||||||
|
if(committing())
|
||||||
|
s->flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|
Loading…
Reference in a new issue