Add tests for delayed var-size writes
This commit is contained in:
parent
4c5464a7e0
commit
5d7cad792f
3 changed files with 169 additions and 82 deletions
|
|
@ -151,9 +151,13 @@ proc setFauxEof*(buffers: PageBuffers, pos: Natural): Natural =
|
|||
proc restoreEof*(buffers: PageBuffers, pos: Natural) =
|
||||
buffers.fauxEofPos = pos
|
||||
|
||||
template allocWritablePage*(pageSize: Natural, writtenToParam: Natural = 0): auto =
|
||||
PageRef(data: allocRef newString(pageSize),
|
||||
writtenTo: writtenToParam)
|
||||
|
||||
func addWritablePage*(buffers: PageBuffers, pageSize: Natural): PageRef =
|
||||
trackWrittenToEnd(buffers)
|
||||
result = PageRef(data: allocRef newString(pageSize))
|
||||
result = allocWritablePage(pageSize)
|
||||
buffers.queue.addLast result
|
||||
|
||||
func getWritablePage*(buffers: PageBuffers,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue