mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 12:05:50 +00:00
* 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.
30 lines
913 B
C#
30 lines
913 B
C#
/*
|
|
* Copyright 2014 Google Inc. All rights reserved.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
|
|
using BenchmarkDotNet.Running;
|
|
|
|
namespace FlatBuffers.Benchmarks
|
|
{
|
|
public static class Program
|
|
{
|
|
public static void Main(string[] args)
|
|
{
|
|
BenchmarkSwitcher
|
|
.FromAssembly(typeof(Program).Assembly)
|
|
.Run(args);
|
|
}
|
|
}
|
|
} |