Move part of libbase to Rust

This commit is contained in:
topjohnwu
2022-08-08 22:53:37 -07:00
parent dd565a11ea
commit 4c0f72f68f
19 changed files with 205 additions and 130 deletions

View File

@@ -219,7 +219,7 @@ void byte_stream::resize(size_t new_pos, bool zero) {
resize = true;
}
if (resize) {
_buf = (uint8_t *) xrealloc(_buf, _cap);
_buf = (uint8_t *) realloc(_buf, _cap);
if (zero)
memset(_buf + old_cap, 0, _cap - old_cap);
}