mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
fix ByteBuffer.grow (#2622)
* fix ByteBuffer.grow --------- Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
This commit is contained in:
@@ -130,7 +130,7 @@ fn usz? ByteBuffer.available(&self) @inline @dynamic
|
|||||||
|
|
||||||
fn void ByteBuffer.grow(&self, usz n)
|
fn void ByteBuffer.grow(&self, usz n)
|
||||||
{
|
{
|
||||||
n = math::next_power_of_2(n);
|
n = math::next_power_of_2(self.bytes.len + n);
|
||||||
char* p = allocator::realloc(self.allocator, self.bytes, n);
|
char* p = allocator::realloc(self.allocator, self.bytes, n);
|
||||||
self.bytes = p[:n];
|
self.bytes = p[:n];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
- Regression with npot vector in struct triggering an assert #2219.
|
- Regression with npot vector in struct triggering an assert #2219.
|
||||||
- Casting bitstruct to wider base type should be single step #2616.
|
- Casting bitstruct to wider base type should be single step #2616.
|
||||||
- Optional does not play well with bit ops #2618.
|
- Optional does not play well with bit ops #2618.
|
||||||
|
- `Bytebuffer.grow` was broken #2622.
|
||||||
|
|
||||||
### Stdlib changes
|
### Stdlib changes
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user