[Swift] Memory usage fix (#8643)

Allows a complete reset for the underlying memory of the
_InternalByteBuffers within FlatBuffers and FlexBuffers.
This commit is contained in:
mustiikhalil
2025-07-18 18:37:58 +02:00
committed by GitHub
parent 2e49b3ba60
commit ca73ff34b7
14 changed files with 146 additions and 58 deletions

View File

@@ -32,7 +32,11 @@ func createProperBuffer() -> FlexBuffersWriter {
var fbx = FlexBuffersWriter(
initialSize: 8,
flags: .shareKeysAndStrings)
write(fbx: &fbx)
return fbx
}
func write(fbx: inout FlexBuffersWriter) {
fbx.map { map in
map.vector(key: "vec") { v in
v.add(int64: -100)
@@ -57,5 +61,4 @@ func createProperBuffer() -> FlexBuffersWriter {
}
fbx.finish()
return fbx
}