aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMCRusher <Modernwarfare3Minecraft64@gmail.com>2019-11-23 23:08:33 -0500
committerGitHub <noreply@github.com>2019-11-23 23:08:33 -0500
commitd49e0a7b90dabbf486902fa9d4a4306aede55087 (patch)
treee2ac48ed25c54c6e3b13eaddb1876331cd020eec /src
parent10e6cde083cf9ddd1ae72850d45c25b1258d0d7e (diff)
downloadzig-d49e0a7b90dabbf486902fa9d4a4306aede55087.tar.gz
zig-d49e0a7b90dabbf486902fa9d4a4306aede55087.zip
Added initCapacity, capacity, and 2 tests.
Added Buffer.initCapcity() to buffer to allow preallocation of a block of memory to reduce future allocations. Uses the added ArrayList.initCapacity() function to achieve this. Added Buffer.capacity() to track current usable allocation size, not counting null byte, and returning 0 if empty or created with Buffer.initNull() Added a test for initCapacity() that shows that no further allocation is performed for an append of size smaller than or equal to capacity when initCapacity is used. Added a test for initSize(), since it did not exist already. Also added a comment to better explain the difference between initSize() and initCapacity() note: forgot in the first commit but thanks to mikdusan for helping me brainstorm, through the process, and for drawing up a draft diff which I tweaked.
Diffstat (limited to 'src')
0 files changed, 0 insertions, 0 deletions