MCRusher d49e0a7b90
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.
2019-11-23 23:08:33 -05:00
..
2019-11-13 00:52:15 +02:00
2019-09-25 23:35:41 -04:00
2019-11-08 15:57:24 -05:00
2019-11-23 14:01:00 -05:00
2019-11-08 15:57:25 -05:00
2019-11-08 15:57:24 -05:00
2019-09-25 23:35:41 -04:00
2019-11-08 15:57:24 -05:00
2019-11-08 15:57:25 -05:00
2019-11-08 15:57:24 -05:00
2019-11-08 15:57:24 -05:00
2019-09-25 23:35:41 -04:00
2019-11-08 15:57:24 -05:00
2019-09-25 23:35:41 -04:00
2019-09-25 23:35:41 -04:00
2019-09-25 23:35:41 -04:00
2019-09-25 23:35:41 -04:00
2019-11-08 01:52:23 -05:00
2019-11-21 23:21:51 -05:00
2019-11-01 22:42:25 -04:00
2019-09-25 23:35:41 -04:00
2019-11-21 17:07:29 -05:00
2019-09-25 23:35:41 -04:00
2019-11-08 15:57:24 -05:00
2019-11-08 15:57:24 -05:00
2019-11-08 15:57:24 -05:00
2019-10-11 18:13:24 -04:00
2019-11-08 15:57:25 -05:00
2019-09-25 23:35:41 -04:00
2019-11-21 17:07:29 -05:00
2019-11-12 17:55:54 +02:00
2019-09-25 23:35:41 -04:00
2019-09-25 23:35:41 -04:00
2019-11-08 15:57:24 -05:00
2019-11-08 15:57:25 -05:00
2019-11-12 17:55:54 +02:00
2019-11-08 01:52:23 -05:00
2019-11-08 15:57:24 -05:00
2019-11-08 15:57:25 -05:00
2019-09-25 23:35:41 -04:00
2019-11-08 15:57:24 -05:00
2019-11-13 00:52:15 +02:00
2019-11-08 15:57:24 -05:00
2019-11-08 15:57:24 -05:00
2019-09-25 23:35:41 -04:00