* Migrate to swift 6.0 & swift-gRPC 2.0
The following migrates to swift 6.0, and also
migrate to swift-grpc 2.0 that uses swift-nio
under the hood to provide nicer API and async await
Adds sendable to enum & update @_implementationOnly imports to use internal imports
* Address PR comments regarding misspelling & proper method naming.
Implements InlineArrays which allow us to use Flatbuffers arrays within
Structs natively, and also implements FlatbufferVectors as a secondary API
when using mutable Structs
Fixes mutations within fixed sizes arrays
Adds tests and remove inout and mutating from generated objects in favor of borrowing
---------
Co-authored-by: Wouter van Oortmerssen <aardappel@gmail.com>
* Implements FlatbuffersVector in swift
Implements FlatbuffersVector which confirms to RandomAccessCollection,
this would give us semi-native sugary syntax to all the arrays in swift port.
This work will also be the foundation of using arrays in swift
* Fix failing tests for Swift
* Offical Swift port for FlexBuffers
This is the offical port for FlexBuffers within
swift, and it introcudes a Common Module where code
is shared between flatbuffers and flexbuffers.
Writing most supported values like maps, vectors,
nil and scalars into a flexbuffer buffer. And includes
tests to verify that its similar to cpp
* Reading a flexbuffer
Implementing reading from a flexbuffer, enabling
most of the buffers features, like most types, maps, vectors,
typedvectors, and fixedtypedvectors.
Currently, if an offset/object cant be read we default to a swift
nil instead of the default flexbuffers 'null' with all values.
* Fixes bazel breaking due to new project structure
Address warnings within the library
* Adds comment on why we added the code & properly enforce the amout of bytes needed
* Adds new API to reduce memory copying within swift
Adds new storage container _InternalByteBuffer which
will be holding the data that will be created within the swift
lib, however reading data will be redirected to ByteBuffer, which
should be able to handle all types of data that swift provide without
the need to copy the data itself. This is due to holding a reference to
the data.
Replaces assumingMemoryBinding with bindMemory which is safer
Adds function that provides access to a UnsafeBufferPointer for
scalars and NativeStructs within swift
Updates docs
Suppress compilation warnings by replacing var with let
Using overflow operators within swift to improve performance
Adds tests for GRPC message creation from a retained _InternalByteBuffer
* Improves vectors performance and adds a benchmark to vectors of offsets in swift
Improves performance for all arrays and for loops
Uses a tuple instead of allocating a struct each time we start iterating over fieldloc
Updates benchmark library
* Fixing swift Wasm ci
* Update NativeObject.swift
Correct the word.
* Update ByteBuffer.swift
Type parameter does not existing, remove it.
* Update ByteBuffer.swift
Correct the word.
Updates copyright from 2023 to 2024 & formats code - updates formatting rules
Updates CI to run with swift 5.8
Adds wasmer & updates command to run carton as a swift plugin
Update bazelci to also accept swift 5.8
Adds swift 5.10 to the test matrix
* Add version of push which takes ContiguousBytes
* Ensure overloads aren't ambiguous
* Add version of createVector
* Add version of push which takes ContiguousBytes
* Ensure overloads aren't ambiguous
* Add version of createVector
* Add similar conditional to other use of ContiguousBytes
* Attempt CI fix
* Use memcpy instead of copyMemory
memcpy is faster in tests
* Add testContiguousBytes
* Add benchmarks
* Add version of createVector
* Add benchmarks
* Update push to copy memory
Since we don't care about endianness, we can simply memcpy the array of scalars
* Remove function and benchmarks
Since we don't care about endianness, a FixedWidthInteger version of createVector isn't needed
* Improve naming
* Add doc comment
Addresses a warning on xcode 15 regarding copying a pointer without safeguards
Address PR comments regarding initializing buffers with flag
Adds a test case for copying unaligned buffers
Formatting code