mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-22 09:18:52 +00:00
Resets buffer without deallocating current pointer (#6247)
Resets buffer without deallocating current pointer & Bumps version
This commit is contained in:
@@ -283,8 +283,6 @@ public struct ByteBuffer {
|
||||
mutating public func clear() {
|
||||
_writerSize = 0
|
||||
alignment = 1
|
||||
_storage.memory.deallocate()
|
||||
_storage.memory = UnsafeMutableRawPointer.allocate(byteCount: _storage.capacity, alignment: alignment)
|
||||
_storage.initialize(for: _storage.capacity)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user