Moves the internal stack to use a pointer stack instead of the native array for improved performance (#8891)

Remove custom flags for native arrays when using flexbuffers on Wasm

Co-authored-by: Wouter van Oortmerssen <aardappel@gmail.com>
This commit is contained in:
mustiikhalil
2026-02-12 19:42:21 +01:00
committed by GitHub
parent fcf75449b8
commit d71c0ab4ac
4 changed files with 144 additions and 9 deletions

View File

@@ -14,6 +14,7 @@
* limitations under the License.
*/
import Common
import Foundation
enum FlexBuffersErrors: Error {
@@ -23,6 +24,10 @@ enum FlexBuffersErrors: Error {
@inline(__always)
public func getRoot(buffer: ByteBuffer) throws -> Reference? {
assert(
isLitteEndian,
"Swift FlexBuffers currently only supports little-endian systems")
let end = buffer.count
if buffer.count < 3 {
throw FlexBuffersErrors.sizeOfBufferIsTooSmall