diff options
author | Derek Bailey <derek.bailey@thermofisher.com> | 2018-08-20 16:31:44 -0700 |
---|---|---|
committer | Wouter van Oortmerssen <aardappel@gmail.com> | 2018-08-20 16:31:44 -0700 |
commit | d8f49e18d70613dec608987ef897c94b95942d75 (patch) | |
tree | b69512cd35c1e2a7be97254f1f822f49b8b0bd96 /tests/MyGame/Example/Stat.cs | |
parent | 1f5eae5d6a135ff6811724f6c57f911d1f46bb15 (diff) | |
download | flatbuffers-d8f49e18d70613dec608987ef897c94b95942d75.tar.gz flatbuffers-d8f49e18d70613dec608987ef897c94b95942d75.tar.bz2 flatbuffers-d8f49e18d70613dec608987ef897c94b95942d75.zip |
Mono Fix for Unsafe Mode (#4887)
* Added preprocessor define for C++ if Template Aliases are supported by the compiler
* Revert "Revert "Performance Increase of Vector of Structures using .NET BlockCopy (#4830)""
This reverts commit 1f5eae5d6a135ff6811724f6c57f911d1f46bb15.
* Put<T> method was inside #if UNSAFE_BYTEBUFFER which caused compilation failure when building in unsafe mode
* Revert "Added preprocessor define for C++ if Template Aliases are supported by the compiler"
This reverts commit a75af7352127c261baf0b6cca5cb823e13e78f11.
Diffstat (limited to 'tests/MyGame/Example/Stat.cs')
-rw-r--r-- | tests/MyGame/Example/Stat.cs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/MyGame/Example/Stat.cs b/tests/MyGame/Example/Stat.cs index e1fd572e..9d78da5a 100644 --- a/tests/MyGame/Example/Stat.cs +++ b/tests/MyGame/Example/Stat.cs @@ -19,6 +19,7 @@ public struct Stat : IFlatbufferObject public string Id { get { int o = __p.__offset(4); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } } public ArraySegment<byte>? GetIdBytes() { return __p.__vector_as_arraysegment(4); } + public byte[] GetIdArray() { return __p.__vector_as_array<byte>(4); } public long Val { get { int o = __p.__offset(6); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } } public bool MutateVal(long val) { int o = __p.__offset(6); if (o != 0) { __p.bb.PutLong(o + __p.bb_pos, val); return true; } else { return false; } } public ushort Count { get { int o = __p.__offset(8); return o != 0 ? __p.bb.GetUshort(o + __p.bb_pos) : (ushort)0; } } |