* Fix lifetime in union _as_ accessors
In the accessors for union field, the return value is implicitly taking the lifetime of &self.
This is irrelevant and prevents usages of the returned value, because it is needlessly bound to the parent field lifetime.
This patch makes the return value inherit the lifetime of the data, like other methods do.
vtable and vtable size depends only on `Table#bb_pos` but calculated in
`Table#_offset` method on each field lookup.
Doing this with every call of `Table#__offset` is redundant.
These values can be read once with change of `Table#bb_pos` and reused
for any field lookup.
Fixed a bug that prevented vtable reuse during buffer construction in the lua library.
Also fixed a bug in vtable equality check that was revealed after the first fix.
On Solaris Sparc, calling NumToString() with a char called the primary
version, not the signed char or unsigned char specializations, which
caused integer to string conversions to be missed.
For some reason, Offset<T> is being considered a scalar, which
causes EndianSwap to be passed an Offset<T>. This doesn't work,
as it does not support types with non-trivial constructors. This
change adds an overload to WriteScalar(), which works around this.
* Remove byte* property in ByteBufferAllocator.
This allows consumers to read/write into native memory, but without
having to always pin the managed `byte[]` when working with managed
memory. This allows for users to not need to Dispose() ByteBuffers
when they are using the default ByteArrayAllocator class.
Instead, we use `Span<byte> GetSpan()` methods to get access to the
underlying memory buffer.
Fix#5181
* Add a set of benchmark tests.
* Add ReadOnly spans.
This allows consumers to use ReadOnlyMemory<byte> as the backing storage
for ByteBuffers, which is useful in read-only scenarios.
* Run tests using ENABLE_SPAN_T in appveyor.
* Fix FlatBuffers.Test.csproj to work on older MSBuild versions.
* Change the test script to test UNSAFE_BYTEBUFFER
* Address PR feedback.
Remove IDisposable from ByteBuffer.
* Respond to PR feedback.
* Add RPM packaging support
Using the existing PackageDebian as template add support for
generating an rpm with the package target.
* Restore debian package target
Also add an option to advertise the fact.
* Update package description
C-n-p from README.md
* Update rpm package maintainer
* Add utility for checking the encoding of source files
- accept source files with ASCII or UTF-8 without BOM
- accept only CRLF line ending
* Fix non-ascii symbol in idl_parcer.cpp
* Remove BOM from test.cpp
There is a test code error that causes the CanReadCppGeneratedWireFile test to fail when ENABLE_SPAN_T is defined. When TestarrayofboolsLength is not 0, then the GetTestarrayofboolsBytes() should have a length.
Introduce a HeapByteBufferFactory singleton instance in order to reduce allocations.
Clarify the usage of LITTLE_ENDIAN ByteBuffers in ByteBufferFactory.
* Implement native_shared attribute for C++.
Fixes#5141. See also #5145.
* Refine comment in idl.h
* Also refine docs
* Revert "Also refine docs"
This reverts commit 09dab7b45c.
* Also refine docs again.
* grumble
This is to protect against cases where part of a project is
compiled with or without this flag, making for very fragile
and hard to find bugs, such as sizeof(Verifier) changing.
Change-Id: I01c895cdc5b44f860e4b0b9c9613bff1983e2b9d
See: https://bugs.chromium.org/p/chromium/issues/detail?id=929847
With the introduction of Windows 10 on ARM (ARM64), code that assumes
that Windows targets are always x86 or x86_64 targets needs to be
updated.
The hot function ReadUInt64 has been optimized in MSVC builds using the
compiler intrinsic __movsb. Since this does not exist on ARM64 Windows,
this change uses the pure C++ path that other platforms use instead.
* [Rust] Added global namespace imports
* Documented the need for global imports
* Added white_space params to GenNamespaceImports
* Removed a \n from GenNamespaceImports
* Add `const` keyword to the `operator-(const uoffset_t &)` function in
`VectorIterator`
* Support reverse iterator in Vector
Introduced a new VectorReverseIterator type. We cannot directly use
`std::reverse_iterator<VectorIterator>` because the signature of
`operator*` and `operator->` in the VectorIterator class are not
standard signatures.
Also added `rbegin()`, `rend()`, `cbegin()`, `cend()`, `crbegin()`
and `crend()` in the Vector class.
* Fix high certainty warnings from PVS-studio
- Introduced FLATBUFFERS_ATTRIBUTE macro to use [[attribute]] if modern C++ compiler used
* Update the note about __cplusplus usage in the MSVC
* Add `NaN` and `Inf` defaults to the C++ generated code.
* Refactoring: add FloatConstantGenerator
* Refactoring-2:
- remove isnan checking for all float/double values
- add most probable implementation of virtual methods of FloatConstantGenerator
* Add conditional (FLATBUFFERS_NAN_DEFAULTS) isnan checking