issues
search
status-im
/
nim-faststreams
Nearly zero-overhead input/output streams for Nim
Apache License 2.0
125
stars
11
forks
source link
prefer `seq[byte]` for page storage
#50
Closed
arnetheduck
closed
8 months ago
arnetheduck
commented
8 months ago
newString
requires zero:ing the storage before use (because it needs to be zero-terminated
avoids
cast
which may or many not work with future nim versions
avoids several cases of UB in case of 0-length things
avoids reduntant zero:ing when using
getOutput
on multi-page buffer
avoids redunant copies due to
cast
not being analyzed well by nim for copy avoidance
for
string
output, introduces an extra allocation on single-page buffers (to construct
string
from
seq[byte]
)
newString
requires zero:ing the storage before use (because it needs to be zero-terminatedcast
which may or many not work with future nim versionsgetOutput
on multi-page buffercast
not being analyzed well by nim for copy avoidancestring
output, introduces an extra allocation on single-page buffers (to constructstring
fromseq[byte]
)