diff --git a/third_party/flatbuffers/android/.project b/third_party/flatbuffers/android/.project
deleted file mode 100644
index 17f0659d4..000000000
--- a/third_party/flatbuffers/android/.project
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
- FlatBufferTest
-
-
-
-
-
-
-
-
-
- 1672434305228
-
- 30
-
- org.eclipse.core.resources.regexFilterMatcher
- node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__
-
-
-
-
diff --git a/third_party/flatbuffers/android/AndroidManifest.xml b/third_party/flatbuffers/android/AndroidManifest.xml
deleted file mode 100644
index a6c97492b..000000000
--- a/third_party/flatbuffers/android/AndroidManifest.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/third_party/flatbuffers/android/app/.gitignore b/third_party/flatbuffers/android/app/.gitignore
deleted file mode 100644
index 796b96d1c..000000000
--- a/third_party/flatbuffers/android/app/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/build
diff --git a/third_party/flatbuffers/android/app/build.gradle b/third_party/flatbuffers/android/app/build.gradle
deleted file mode 100644
index 994178309..000000000
--- a/third_party/flatbuffers/android/app/build.gradle
+++ /dev/null
@@ -1,125 +0,0 @@
-apply plugin: 'com.android.application'
-apply plugin: 'kotlin-android'
-
-android {
- compileSdk 33
-
- defaultConfig {
- applicationId "com.flatbuffers.app"
- minSdkVersion 26
- targetSdkVersion 33
- versionCode 1
- versionName "1.0"
-
- compileOptions {
- sourceCompatibility JavaVersion.VERSION_1_8
- targetCompatibility JavaVersion.VERSION_1_8
- }
-
- sourceSets {
- main {
- java {
- srcDir '../../java/src/main/java/'
- }
- }
- }
-
- ndk {
- abiFilters 'arm64-v8a', 'armeabi-v7a'
- }
-
- testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
- externalNativeBuild {
- cmake {
- arguments "-DFLATBUFFERS_SRC=${rootProject.projectDir}/.."
- }
- }
- }
-
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
- }
- }
-
- externalNativeBuild {
- cmake {
- path "src/main/cpp/CMakeLists.txt"
- }
- }
-
- task generateFbsCpp(type: Exec) {
- def inputDir = file("$projectDir/src/main/fbs")
- def outputCppDir = file("$projectDir/src/main/cpp/generated/")
- def fbsFiles = layout.files { file(inputDir).listFiles() }.filter { File f -> f.name.endsWith(".fbs") }.toList()
- ignoreExitValue(true)
-
- standardOutput = new ByteArrayOutputStream()
- errorOutput = new ByteArrayOutputStream()
- def commandLineArgs = ['flatc', '-o', outputCppDir, '--cpp']
- fbsFiles.forEach{
- commandLineArgs.add(it.path)
- }
-
- commandLine commandLineArgs
-
- doFirst {
- delete "$outputCppDir/"
- mkdir "$outputCppDir/"
- }
-
- doLast {
- if (executionResult.get().exitValue != 0) {
- throw new GradleException("flatc failed with: ${executionResult.get().toString()}")
- }
- }
- }
-
- task generateFbsKotlin(type: Exec) {
- def inputDir = file("$projectDir/src/main/fbs")
- def outputKotlinDir = file("$projectDir/src/main/java/generated/")
- def fbsFiles = layout.files { file(inputDir).listFiles() }.filter { File f -> f.name.endsWith(".fbs") }.toList()
- ignoreExitValue(true)
-
- standardOutput = new ByteArrayOutputStream()
- errorOutput = new ByteArrayOutputStream()
-
- setErrorOutput(errorOutput)
- setStandardOutput(standardOutput)
-
- def commandLineArgs = ['flatc', '-o', outputKotlinDir, '--kotlin']
- fbsFiles.forEach{
- commandLineArgs.add(it.path)
- }
- commandLine commandLineArgs
-
- doFirst {
- delete "$outputKotlinDir/"
- mkdir "$outputKotlinDir/"
- }
- doLast {
- if (executionResult.get().exitValue != 0) {
- throw new GradleException("flatc failed with: ${executionResult.get().toString()}")
- }
- }
- }
-
- afterEvaluate {
- tasks.named("preBuild") {
- dependsOn(generateFbsKotlin)
- dependsOn(generateFbsCpp)
- }
- }
- namespace 'com.flatbuffers.app'
-}
-
-dependencies {
- implementation fileTree(dir: "libs", include: ["*.jar"])
- implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
- implementation 'androidx.appcompat:appcompat:1.6.1'
-
- // If you using java runtime you can add its dependency as the example below
- // implementation 'com.google.flatbuffers:flatbuffers-java:$latest_version'
-
-}
diff --git a/third_party/flatbuffers/android/app/proguard-rules.pro b/third_party/flatbuffers/android/app/proguard-rules.pro
deleted file mode 100644
index f1b424510..000000000
--- a/third_party/flatbuffers/android/app/proguard-rules.pro
+++ /dev/null
@@ -1,21 +0,0 @@
-# Add project specific ProGuard rules here.
-# You can control the set of applied configuration files using the
-# proguardFiles setting in build.gradle.
-#
-# For more details, see
-# http://developer.android.com/guide/developing/tools/proguard.html
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-# public *;
-#}
-
-# Uncomment this to preserve the line number information for
-# debugging stack traces.
-#-keepattributes SourceFile,LineNumberTable
-
-# If you keep the line number information, uncomment this to
-# hide the original source file name.
-#-renamesourcefileattribute SourceFile
diff --git a/third_party/flatbuffers/android/app/src/main/AndroidManifest.xml b/third_party/flatbuffers/android/app/src/main/AndroidManifest.xml
deleted file mode 100644
index 53caca65b..000000000
--- a/third_party/flatbuffers/android/app/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/third_party/flatbuffers/android/app/src/main/cpp/CMakeLists.txt b/third_party/flatbuffers/android/app/src/main/cpp/CMakeLists.txt
deleted file mode 100644
index abb8250bd..000000000
--- a/third_party/flatbuffers/android/app/src/main/cpp/CMakeLists.txt
+++ /dev/null
@@ -1,53 +0,0 @@
-# For more information about using CMake with Android Studio, read the
-# documentation: https://d.android.com/studio/projects/add-native-code.html
-
-# Sets the minimum version of CMake required to build the native library.
-
-cmake_minimum_required(VERSION 3.4.1)
-
-# Creates and names a library, sets it as either STATIC
-# or SHARED, and provides the relative paths to its source code.
-# You can define multiple libraries, and CMake builds them for you.
-# Gradle automatically packages shared libraries with your APK.
-
-include_directories(${FLATBUFFERS_SRC}/include)
-
-add_subdirectory(flatbuffers)
-
-FILE(GLOB Generated_SRCS generated/*.h)
-
-add_library( # Sets the name of the library.
- native-lib
-
- # Sets the library as a shared library.
- SHARED
-
- # Provides a relative path to your source file(s).
- animals.cpp
- ${Generated_SRCS}
-
-)
-
-# Searches for a specified prebuilt library and stores the path as a
-# variable. Because CMake includes system libraries in the search path by
-# default, you only need to specify the name of the public NDK library
-# you want to add. CMake verifies that the library exists before
-# completing its build.
-
-find_library( # Sets the name of the path variable.
- log-lib
-
- # Specifies the name of the NDK library that
- # you want CMake to locate.
- log )
-
-# Specifies libraries CMake should link to your target library. You
-# can link multiple libraries, such as libraries you define in this
-# build script, prebuilt third-party libraries, or system libraries.
-
-target_link_libraries( # Specifies the target library.
- native-lib
- flatbuffers
- # Links the target library to the log library
- # included in the NDK.
- ${log-lib} )
diff --git a/third_party/flatbuffers/android/app/src/main/cpp/animals.cpp b/third_party/flatbuffers/android/app/src/main/cpp/animals.cpp
deleted file mode 100644
index bf87b875c..000000000
--- a/third_party/flatbuffers/android/app/src/main/cpp/animals.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * 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.
- */
-
-#include
-#include
-#include
-#include "generated/animal_generated.h"
-
-using namespace com::fbs::app;
-using namespace flatbuffers;
-
-extern "C" JNIEXPORT jbyteArray JNICALL Java_com_flatbuffers_app_MainActivity_createAnimalFromJNI(
- JNIEnv* env,
- jobject /* this */) {
- // create a new animal flatbuffers
- auto fb = FlatBufferBuilder(1024);
- auto tiger = CreateAnimalDirect(fb, "Tiger", "Roar", 300);
- fb.Finish(tiger);
-
- // copies it to a Java byte array.
- auto buf = reinterpret_cast(fb.GetBufferPointer());
- int size = fb.GetSize();
- auto ret = env->NewByteArray(size);
- env->SetByteArrayRegion (ret, 0, fb.GetSize(), buf);
- return ret;
-}
diff --git a/third_party/flatbuffers/android/app/src/main/cpp/flatbuffers/CMakeLists.txt b/third_party/flatbuffers/android/app/src/main/cpp/flatbuffers/CMakeLists.txt
deleted file mode 100644
index 144523ee8..000000000
--- a/third_party/flatbuffers/android/app/src/main/cpp/flatbuffers/CMakeLists.txt
+++ /dev/null
@@ -1,56 +0,0 @@
-# For more information about using CMake with Android Studio, read the
-# documentation: https://d.android.com/studio/projects/add-native-code.html
-
-# Sets the minimum version of CMake required to build the native library.
-
-cmake_minimum_required(VERSION 3.4.1)
-
-include_directories(${FLATBUFFERS_SRC}/include)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 -fexceptions -Wall -DFLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE")
-
-# Certain platforms such as ARM do not use signed chars by default
-# which causes issues with certain bounds checks.
-set(CMAKE_CXX_FLAGS
- "${CMAKE_CXX_FLAGS} -fsigned-char")
-
-set(FlatBuffers_Library_SRCS
- ${FLATBUFFERS_SRC}/include/flatbuffers/allocator.h
- ${FLATBUFFERS_SRC}/include/flatbuffers/array.h
- ${FLATBUFFERS_SRC}/include/flatbuffers/base.h
- ${FLATBUFFERS_SRC}/include/flatbuffers/buffer.h
- ${FLATBUFFERS_SRC}/include/flatbuffers/buffer_ref.h
- ${FLATBUFFERS_SRC}/include/flatbuffers/default_allocator.h
- ${FLATBUFFERS_SRC}/include/flatbuffers/detached_buffer.h
- ${FLATBUFFERS_SRC}/include/flatbuffers/flatbuffer_builder.h
- ${FLATBUFFERS_SRC}/include/flatbuffers/flatbuffers.h
- ${FLATBUFFERS_SRC}/include/flatbuffers/flexbuffers.h
- ${FLATBUFFERS_SRC}/include/flatbuffers/flex_flat_util.h
- ${FLATBUFFERS_SRC}/include/flatbuffers/hash.h
- ${FLATBUFFERS_SRC}/include/flatbuffers/idl.h
- ${FLATBUFFERS_SRC}/include/flatbuffers/minireflect.h
- ${FLATBUFFERS_SRC}/include/flatbuffers/reflection.h
- ${FLATBUFFERS_SRC}/include/flatbuffers/reflection_generated.h
- ${FLATBUFFERS_SRC}/include/flatbuffers/registry.h
- ${FLATBUFFERS_SRC}/include/flatbuffers/stl_emulation.h
- ${FLATBUFFERS_SRC}/include/flatbuffers/string.h
- ${FLATBUFFERS_SRC}/include/flatbuffers/struct.h
- ${FLATBUFFERS_SRC}/include/flatbuffers/table.h
- ${FLATBUFFERS_SRC}/include/flatbuffers/util.h
- ${FLATBUFFERS_SRC}/include/flatbuffers/vector.h
- ${FLATBUFFERS_SRC}/include/flatbuffers/vector_downward.h
- ${FLATBUFFERS_SRC}/include/flatbuffers/verifier.h
- ${FLATBUFFERS_SRC}/src/idl_parser.cpp
- ${FLATBUFFERS_SRC}/src/idl_gen_text.cpp
- ${FLATBUFFERS_SRC}/src/reflection.cpp
- ${FLATBUFFERS_SRC}/src/util.cpp
- ${FLATBUFFERS_SRC}/src/idl_gen_fbs.cpp
- ${FLATBUFFERS_SRC}/src/code_generators.cpp
- )
-
-add_library( # Sets the name of the library.
- flatbuffers
-
- ${FlatBuffers_Library_SRCS}
- ${Generated_SRCS}
-)
diff --git a/third_party/flatbuffers/android/app/src/main/cpp/generated/animal_generated.h b/third_party/flatbuffers/android/app/src/main/cpp/generated/animal_generated.h
deleted file mode 100644
index 313cec42c..000000000
--- a/third_party/flatbuffers/android/app/src/main/cpp/generated/animal_generated.h
+++ /dev/null
@@ -1,134 +0,0 @@
-// automatically generated by the FlatBuffers compiler, do not modify
-
-
-#ifndef FLATBUFFERS_GENERATED_ANIMAL_COM_FBS_APP_H_
-#define FLATBUFFERS_GENERATED_ANIMAL_COM_FBS_APP_H_
-
-#include "flatbuffers/flatbuffers.h"
-
-// Ensure the included flatbuffers.h is the same version as when this file was
-// generated, otherwise it may not be compatible.
-static_assert(FLATBUFFERS_VERSION_MAJOR == 23 &&
- FLATBUFFERS_VERSION_MINOR == 1 &&
- FLATBUFFERS_VERSION_REVISION == 21,
- "Non-compatible flatbuffers version included");
-
-namespace com {
-namespace fbs {
-namespace app {
-
-struct Animal;
-struct AnimalBuilder;
-
-struct Animal FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
- typedef AnimalBuilder Builder;
- enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
- VT_NAME = 4,
- VT_SOUND = 6,
- VT_WEIGHT = 8
- };
- const ::flatbuffers::String *name() const {
- return GetPointer(VT_NAME);
- }
- const ::flatbuffers::String *sound() const {
- return GetPointer(VT_SOUND);
- }
- uint16_t weight() const {
- return GetField(VT_WEIGHT, 0);
- }
- bool Verify(::flatbuffers::Verifier &verifier) const {
- return VerifyTableStart(verifier) &&
- VerifyOffset(verifier, VT_NAME) &&
- verifier.VerifyString(name()) &&
- VerifyOffset(verifier, VT_SOUND) &&
- verifier.VerifyString(sound()) &&
- VerifyField(verifier, VT_WEIGHT, 2) &&
- verifier.EndTable();
- }
-};
-
-struct AnimalBuilder {
- typedef Animal Table;
- ::flatbuffers::FlatBufferBuilder &fbb_;
- ::flatbuffers::uoffset_t start_;
- void add_name(::flatbuffers::Offset<::flatbuffers::String> name) {
- fbb_.AddOffset(Animal::VT_NAME, name);
- }
- void add_sound(::flatbuffers::Offset<::flatbuffers::String> sound) {
- fbb_.AddOffset(Animal::VT_SOUND, sound);
- }
- void add_weight(uint16_t weight) {
- fbb_.AddElement(Animal::VT_WEIGHT, weight, 0);
- }
- explicit AnimalBuilder(::flatbuffers::FlatBufferBuilder &_fbb)
- : fbb_(_fbb) {
- start_ = fbb_.StartTable();
- }
- ::flatbuffers::Offset Finish() {
- const auto end = fbb_.EndTable(start_);
- auto o = ::flatbuffers::Offset(end);
- return o;
- }
-};
-
-inline ::flatbuffers::Offset CreateAnimal(
- ::flatbuffers::FlatBufferBuilder &_fbb,
- ::flatbuffers::Offset<::flatbuffers::String> name = 0,
- ::flatbuffers::Offset<::flatbuffers::String> sound = 0,
- uint16_t weight = 0) {
- AnimalBuilder builder_(_fbb);
- builder_.add_sound(sound);
- builder_.add_name(name);
- builder_.add_weight(weight);
- return builder_.Finish();
-}
-
-inline ::flatbuffers::Offset CreateAnimalDirect(
- ::flatbuffers::FlatBufferBuilder &_fbb,
- const char *name = nullptr,
- const char *sound = nullptr,
- uint16_t weight = 0) {
- auto name__ = name ? _fbb.CreateString(name) : 0;
- auto sound__ = sound ? _fbb.CreateString(sound) : 0;
- return com::fbs::app::CreateAnimal(
- _fbb,
- name__,
- sound__,
- weight);
-}
-
-inline const com::fbs::app::Animal *GetAnimal(const void *buf) {
- return ::flatbuffers::GetRoot(buf);
-}
-
-inline const com::fbs::app::Animal *GetSizePrefixedAnimal(const void *buf) {
- return ::flatbuffers::GetSizePrefixedRoot(buf);
-}
-
-inline bool VerifyAnimalBuffer(
- ::flatbuffers::Verifier &verifier) {
- return verifier.VerifyBuffer(nullptr);
-}
-
-inline bool VerifySizePrefixedAnimalBuffer(
- ::flatbuffers::Verifier &verifier) {
- return verifier.VerifySizePrefixedBuffer(nullptr);
-}
-
-inline void FinishAnimalBuffer(
- ::flatbuffers::FlatBufferBuilder &fbb,
- ::flatbuffers::Offset root) {
- fbb.Finish(root);
-}
-
-inline void FinishSizePrefixedAnimalBuffer(
- ::flatbuffers::FlatBufferBuilder &fbb,
- ::flatbuffers::Offset root) {
- fbb.FinishSizePrefixed(root);
-}
-
-} // namespace app
-} // namespace fbs
-} // namespace com
-
-#endif // FLATBUFFERS_GENERATED_ANIMAL_COM_FBS_APP_H_
diff --git a/third_party/flatbuffers/android/app/src/main/fbs/animal.fbs b/third_party/flatbuffers/android/app/src/main/fbs/animal.fbs
deleted file mode 100644
index 479e22b29..000000000
--- a/third_party/flatbuffers/android/app/src/main/fbs/animal.fbs
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright 2015 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.
-
-namespace com.fbs.app;
-
-table Animal {
- name:string;
- sound:string;
- weight: uint16;
-}
-
-root_type Animal;
diff --git a/third_party/flatbuffers/android/app/src/main/java/com/flatbuffers/app/MainActivity.kt b/third_party/flatbuffers/android/app/src/main/java/com/flatbuffers/app/MainActivity.kt
deleted file mode 100644
index cdc35730e..000000000
--- a/third_party/flatbuffers/android/app/src/main/java/com/flatbuffers/app/MainActivity.kt
+++ /dev/null
@@ -1,51 +0,0 @@
-package com.flatbuffers.app
-
-import android.annotation.SuppressLint
-import androidx.appcompat.app.AppCompatActivity
-import android.os.Bundle
-import android.widget.TextView
-import com.fbs.app.Animal
-import com.google.flatbuffers.FlatBufferBuilder
-import java.nio.ByteBuffer
-
-@ExperimentalUnsignedTypes
-class MainActivity : AppCompatActivity() {
-
- @SuppressLint("SetTextI18n")
- override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
- setContentView(R.layout.activity_main)
-
- val tiger = Animal.getRootAsAnimal(ByteBuffer.wrap(createAnimalFromJNI()))
- findViewById(R.id.tv_animal_one).text = animalInfo(tiger)
-
- findViewById(R.id.tv_animal_two).text = animalInfo(createAnimalFromKotlin())
- }
-
- // This function is a sample of communicating FlatBuffers between JNI (native C++) and Java.
- // Implementation can be found on animals.cpp file.
- private external fun createAnimalFromJNI(): ByteArray
-
- // Create a "Cow" Animal flatbuffers from Kotlin
- private fun createAnimalFromKotlin():Animal {
- val fb = FlatBufferBuilder(100)
- val cowOffset = Animal.createAnimal(
- builder = fb,
- nameOffset = fb.createString("Cow"),
- soundOffset = fb.createString("Moo"),
- weight = 720u
- )
- fb.finish(cowOffset)
- return Animal.getRootAsAnimal(fb.dataBuffer())
- }
-
- private fun animalInfo(animal: Animal): String =
- "The ${animal.name} sound is ${animal.sound} and it weights ${animal.weight}kg."
-
- companion object {
- // Used to load the 'native-lib' library on application startup.
- init {
- System.loadLibrary("native-lib")
- }
- }
-}
diff --git a/third_party/flatbuffers/android/app/src/main/java/generated/com/fbs/app/Animal.kt b/third_party/flatbuffers/android/app/src/main/java/generated/com/fbs/app/Animal.kt
deleted file mode 100644
index 1730eb4f1..000000000
--- a/third_party/flatbuffers/android/app/src/main/java/generated/com/fbs/app/Animal.kt
+++ /dev/null
@@ -1,84 +0,0 @@
-// automatically generated by the FlatBuffers compiler, do not modify
-
-package com.fbs.app
-
-import com.google.flatbuffers.BaseVector
-import com.google.flatbuffers.BooleanVector
-import com.google.flatbuffers.ByteVector
-import com.google.flatbuffers.Constants
-import com.google.flatbuffers.DoubleVector
-import com.google.flatbuffers.FlatBufferBuilder
-import com.google.flatbuffers.FloatVector
-import com.google.flatbuffers.LongVector
-import com.google.flatbuffers.StringVector
-import com.google.flatbuffers.Struct
-import com.google.flatbuffers.Table
-import com.google.flatbuffers.UnionVector
-import java.nio.ByteBuffer
-import java.nio.ByteOrder
-import kotlin.math.sign
-
-@Suppress("unused")
-@kotlin.ExperimentalUnsignedTypes
-class Animal : Table() {
-
- fun __init(_i: Int, _bb: ByteBuffer) {
- __reset(_i, _bb)
- }
- fun __assign(_i: Int, _bb: ByteBuffer) : Animal {
- __init(_i, _bb)
- return this
- }
- val name : String?
- get() {
- val o = __offset(4)
- return if (o != 0) {
- __string(o + bb_pos)
- } else {
- null
- }
- }
- val nameAsByteBuffer : ByteBuffer get() = __vector_as_bytebuffer(4, 1)
- fun nameInByteBuffer(_bb: ByteBuffer) : ByteBuffer = __vector_in_bytebuffer(_bb, 4, 1)
- val sound : String?
- get() {
- val o = __offset(6)
- return if (o != 0) {
- __string(o + bb_pos)
- } else {
- null
- }
- }
- val soundAsByteBuffer : ByteBuffer get() = __vector_as_bytebuffer(6, 1)
- fun soundInByteBuffer(_bb: ByteBuffer) : ByteBuffer = __vector_in_bytebuffer(_bb, 6, 1)
- val weight : UShort
- get() {
- val o = __offset(8)
- return if(o != 0) bb.getShort(o + bb_pos).toUShort() else 0u
- }
- companion object {
- fun validateVersion() = Constants.FLATBUFFERS_24_3_25()
- fun getRootAsAnimal(_bb: ByteBuffer): Animal = getRootAsAnimal(_bb, Animal())
- fun getRootAsAnimal(_bb: ByteBuffer, obj: Animal): Animal {
- _bb.order(ByteOrder.LITTLE_ENDIAN)
- return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb))
- }
- fun createAnimal(builder: FlatBufferBuilder, nameOffset: Int, soundOffset: Int, weight: UShort) : Int {
- builder.startTable(3)
- addSound(builder, soundOffset)
- addName(builder, nameOffset)
- addWeight(builder, weight)
- return endAnimal(builder)
- }
- fun startAnimal(builder: FlatBufferBuilder) = builder.startTable(3)
- fun addName(builder: FlatBufferBuilder, name: Int) = builder.addOffset(0, name, 0)
- fun addSound(builder: FlatBufferBuilder, sound: Int) = builder.addOffset(1, sound, 0)
- fun addWeight(builder: FlatBufferBuilder, weight: UShort) = builder.addShort(2, weight.toShort(), 0)
- fun endAnimal(builder: FlatBufferBuilder) : Int {
- val o = builder.endTable()
- return o
- }
- fun finishAnimalBuffer(builder: FlatBufferBuilder, offset: Int) = builder.finish(offset)
- fun finishSizePrefixedAnimalBuffer(builder: FlatBufferBuilder, offset: Int) = builder.finishSizePrefixed(offset)
- }
-}
diff --git a/third_party/flatbuffers/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/third_party/flatbuffers/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
deleted file mode 100644
index 7706ab9e6..000000000
--- a/third_party/flatbuffers/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/third_party/flatbuffers/android/app/src/main/res/drawable/ic_launcher_background.xml b/third_party/flatbuffers/android/app/src/main/res/drawable/ic_launcher_background.xml
deleted file mode 100644
index 07d5da9cb..000000000
--- a/third_party/flatbuffers/android/app/src/main/res/drawable/ic_launcher_background.xml
+++ /dev/null
@@ -1,170 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/third_party/flatbuffers/android/app/src/main/res/layout/activity_main.xml b/third_party/flatbuffers/android/app/src/main/res/layout/activity_main.xml
deleted file mode 100644
index d339c2240..000000000
--- a/third_party/flatbuffers/android/app/src/main/res/layout/activity_main.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/third_party/flatbuffers/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/third_party/flatbuffers/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
deleted file mode 100644
index 6b78462d6..000000000
--- a/third_party/flatbuffers/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
diff --git a/third_party/flatbuffers/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/third_party/flatbuffers/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
deleted file mode 100644
index 6b78462d6..000000000
--- a/third_party/flatbuffers/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
diff --git a/third_party/flatbuffers/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/third_party/flatbuffers/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
deleted file mode 100644
index a571e6009..000000000
Binary files a/third_party/flatbuffers/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ
diff --git a/third_party/flatbuffers/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/third_party/flatbuffers/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
deleted file mode 100644
index 61da551c5..000000000
Binary files a/third_party/flatbuffers/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png and /dev/null differ
diff --git a/third_party/flatbuffers/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/third_party/flatbuffers/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
deleted file mode 100644
index c41dd2853..000000000
Binary files a/third_party/flatbuffers/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ
diff --git a/third_party/flatbuffers/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/third_party/flatbuffers/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
deleted file mode 100644
index db5080a75..000000000
Binary files a/third_party/flatbuffers/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png and /dev/null differ
diff --git a/third_party/flatbuffers/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/third_party/flatbuffers/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
deleted file mode 100644
index 6dba46dab..000000000
Binary files a/third_party/flatbuffers/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ
diff --git a/third_party/flatbuffers/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/third_party/flatbuffers/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
deleted file mode 100644
index da31a871c..000000000
Binary files a/third_party/flatbuffers/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png and /dev/null differ
diff --git a/third_party/flatbuffers/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/third_party/flatbuffers/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
deleted file mode 100644
index 15ac68172..000000000
Binary files a/third_party/flatbuffers/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ
diff --git a/third_party/flatbuffers/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/third_party/flatbuffers/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
deleted file mode 100644
index b216f2d31..000000000
Binary files a/third_party/flatbuffers/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png and /dev/null differ
diff --git a/third_party/flatbuffers/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/third_party/flatbuffers/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
deleted file mode 100644
index f25a41974..000000000
Binary files a/third_party/flatbuffers/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ
diff --git a/third_party/flatbuffers/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/third_party/flatbuffers/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
deleted file mode 100644
index e96783ccc..000000000
Binary files a/third_party/flatbuffers/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png and /dev/null differ
diff --git a/third_party/flatbuffers/android/app/src/main/res/values/colors.xml b/third_party/flatbuffers/android/app/src/main/res/values/colors.xml
deleted file mode 100644
index 030098fe0..000000000
--- a/third_party/flatbuffers/android/app/src/main/res/values/colors.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
- #6200EE
- #3700B3
- #03DAC5
-
diff --git a/third_party/flatbuffers/android/app/src/main/res/values/strings.xml b/third_party/flatbuffers/android/app/src/main/res/values/strings.xml
deleted file mode 100644
index 71d53e98a..000000000
--- a/third_party/flatbuffers/android/app/src/main/res/values/strings.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
- FlatbuffersTestApp
-
diff --git a/third_party/flatbuffers/android/app/src/main/res/values/styles.xml b/third_party/flatbuffers/android/app/src/main/res/values/styles.xml
deleted file mode 100644
index 391ec9ae3..000000000
--- a/third_party/flatbuffers/android/app/src/main/res/values/styles.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
diff --git a/third_party/flatbuffers/android/build.gradle b/third_party/flatbuffers/android/build.gradle
deleted file mode 100644
index 7e9cdec51..000000000
--- a/third_party/flatbuffers/android/build.gradle
+++ /dev/null
@@ -1,35 +0,0 @@
-// Top-level build file where you can add configuration options common to all sub-projects/modules.
-buildscript {
- ext.kotlin_version = "1.7.21"
- repositories {
- google()
- mavenCentral()
- }
- dependencies {
- classpath 'com.android.tools.build:gradle:7.4.1'
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
-
- // NOTE: Do not place your application dependencies here; they belong
- // in the individual module build.gradle files
- }
-}
-
-allprojects {
- repositories {
- google()
- mavenCentral()
- }
-}
-
-tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
- sourceCompatibility = JavaVersion.VERSION_1_8
- targetCompatibility = JavaVersion.VERSION_1_8
-
- compileKotlin {
- dependsOn flatbuffer
- }
-}
-
-task clean(type: Delete) {
- delete rootProject.buildDir
-}
diff --git a/third_party/flatbuffers/android/gradle.properties b/third_party/flatbuffers/android/gradle.properties
deleted file mode 100644
index bf3068ddd..000000000
--- a/third_party/flatbuffers/android/gradle.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-# Project-wide Gradle settings.
-# IDE (e.g. Android Studio) users:
-# Gradle settings configured through the IDE *will override*
-# any settings specified in this file.
-# For more details on how to configure your build environment visit
-# http://www.gradle.org/docs/current/userguide/build_environment.html
-# Specifies the JVM arguments used for the daemon process.
-# The setting is particularly useful for tweaking memory settings.
-org.gradle.jvmargs=-Xmx2048m
-# When configured, Gradle will run in incubating parallel mode.
-# This option should only be used with decoupled projects. More details, visit
-# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
-# org.gradle.parallel=true
-# AndroidX package structure to make it clearer which packages are bundled with the
-# Android operating system, and which are packaged with your app"s APK
-# https://developer.android.com/topic/libraries/support-library/androidx-rn
-android.useAndroidX=true
-# Automatically convert third-party libraries to use AndroidX
-android.enableJetifier=true
-# Kotlin code style for this project: "official" or "obsolete":
-kotlin.code.style=official
-# Use parallel builds
-org.gradle.parallel=true
\ No newline at end of file
diff --git a/third_party/flatbuffers/android/gradle/wrapper/gradle-wrapper.jar b/third_party/flatbuffers/android/gradle/wrapper/gradle-wrapper.jar
deleted file mode 100644
index 41d9927a4..000000000
Binary files a/third_party/flatbuffers/android/gradle/wrapper/gradle-wrapper.jar and /dev/null differ
diff --git a/third_party/flatbuffers/android/gradle/wrapper/gradle-wrapper.properties b/third_party/flatbuffers/android/gradle/wrapper/gradle-wrapper.properties
deleted file mode 100644
index f72df95a7..000000000
--- a/third_party/flatbuffers/android/gradle/wrapper/gradle-wrapper.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-distributionBase=GRADLE_USER_HOME
-distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-bin.zip
-zipStoreBase=GRADLE_USER_HOME
-zipStorePath=wrapper/dists
diff --git a/third_party/flatbuffers/android/gradlew b/third_party/flatbuffers/android/gradlew
deleted file mode 100755
index cccdd3d51..000000000
--- a/third_party/flatbuffers/android/gradlew
+++ /dev/null
@@ -1,172 +0,0 @@
-#!/usr/bin/env sh
-
-##############################################################################
-##
-## Gradle start up script for UN*X
-##
-##############################################################################
-
-# Attempt to set APP_HOME
-# Resolve links: $0 may be a link
-PRG="$0"
-# Need this for relative symlinks.
-while [ -h "$PRG" ] ; do
- ls=`ls -ld "$PRG"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- PRG="$link"
- else
- PRG=`dirname "$PRG"`"/$link"
- fi
-done
-SAVED="`pwd`"
-cd "`dirname \"$PRG\"`/" >/dev/null
-APP_HOME="`pwd -P`"
-cd "$SAVED" >/dev/null
-
-APP_NAME="Gradle"
-APP_BASE_NAME=`basename "$0"`
-
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS=""
-
-# Use the maximum available, or set MAX_FD != -1 to use that value.
-MAX_FD="maximum"
-
-warn () {
- echo "$*"
-}
-
-die () {
- echo
- echo "$*"
- echo
- exit 1
-}
-
-# OS specific support (must be 'true' or 'false').
-cygwin=false
-msys=false
-darwin=false
-nonstop=false
-case "`uname`" in
- CYGWIN* )
- cygwin=true
- ;;
- Darwin* )
- darwin=true
- ;;
- MINGW* )
- msys=true
- ;;
- NONSTOP* )
- nonstop=true
- ;;
-esac
-
-CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
-
-# Determine the Java command to use to start the JVM.
-if [ -n "$JAVA_HOME" ] ; then
- if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
- # IBM's JDK on AIX uses strange locations for the executables
- JAVACMD="$JAVA_HOME/jre/sh/java"
- else
- JAVACMD="$JAVA_HOME/bin/java"
- fi
- if [ ! -x "$JAVACMD" ] ; then
- die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
- fi
-else
- JAVACMD="java"
- which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
-fi
-
-# Increase the maximum file descriptors if we can.
-if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
- MAX_FD_LIMIT=`ulimit -H -n`
- if [ $? -eq 0 ] ; then
- if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
- MAX_FD="$MAX_FD_LIMIT"
- fi
- ulimit -n $MAX_FD
- if [ $? -ne 0 ] ; then
- warn "Could not set maximum file descriptor limit: $MAX_FD"
- fi
- else
- warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
- fi
-fi
-
-# For Darwin, add options to specify how the application appears in the dock
-if $darwin; then
- GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
-fi
-
-# For Cygwin, switch paths to Windows format before running java
-if $cygwin ; then
- APP_HOME=`cygpath --path --mixed "$APP_HOME"`
- CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
- JAVACMD=`cygpath --unix "$JAVACMD"`
-
- # We build the pattern for arguments to be converted via cygpath
- ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
- SEP=""
- for dir in $ROOTDIRSRAW ; do
- ROOTDIRS="$ROOTDIRS$SEP$dir"
- SEP="|"
- done
- OURCYGPATTERN="(^($ROOTDIRS))"
- # Add a user-defined pattern to the cygpath arguments
- if [ "$GRADLE_CYGPATTERN" != "" ] ; then
- OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
- fi
- # Now convert the arguments - kludge to limit ourselves to /bin/sh
- i=0
- for arg in "$@" ; do
- CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
- CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
-
- if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
- eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
- else
- eval `echo args$i`="\"$arg\""
- fi
- i=$((i+1))
- done
- case $i in
- (0) set -- ;;
- (1) set -- "$args0" ;;
- (2) set -- "$args0" "$args1" ;;
- (3) set -- "$args0" "$args1" "$args2" ;;
- (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
- (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
- (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
- (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
- (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
- (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
- esac
-fi
-
-# Escape application args
-save () {
- for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
- echo " "
-}
-APP_ARGS=$(save "$@")
-
-# Collect all arguments for the java command, following the shell quoting and substitution rules
-eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
-
-# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
-if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
- cd "$(dirname "$0")"
-fi
-
-exec "$JAVACMD" "$@"
diff --git a/third_party/flatbuffers/android/gradlew.bat b/third_party/flatbuffers/android/gradlew.bat
deleted file mode 100644
index f9553162f..000000000
--- a/third_party/flatbuffers/android/gradlew.bat
+++ /dev/null
@@ -1,84 +0,0 @@
-@if "%DEBUG%" == "" @echo off
-@rem ##########################################################################
-@rem
-@rem Gradle startup script for Windows
-@rem
-@rem ##########################################################################
-
-@rem Set local scope for the variables with windows NT shell
-if "%OS%"=="Windows_NT" setlocal
-
-set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.
-set APP_BASE_NAME=%~n0
-set APP_HOME=%DIRNAME%
-
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS=
-
-@rem Find java.exe
-if defined JAVA_HOME goto findJavaFromJavaHome
-
-set JAVA_EXE=java.exe
-%JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto init
-
-echo.
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:findJavaFromJavaHome
-set JAVA_HOME=%JAVA_HOME:"=%
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-
-if exist "%JAVA_EXE%" goto init
-
-echo.
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:init
-@rem Get command-line arguments, handling Windows variants
-
-if not "%OS%" == "Windows_NT" goto win9xME_args
-
-:win9xME_args
-@rem Slurp the command line arguments.
-set CMD_LINE_ARGS=
-set _SKIP=2
-
-:win9xME_args_slurp
-if "x%~1" == "x" goto execute
-
-set CMD_LINE_ARGS=%*
-
-:execute
-@rem Setup the command line
-
-set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
-
-@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
-
-:end
-@rem End local scope for the variables with windows NT shell
-if "%ERRORLEVEL%"=="0" goto mainEnd
-
-:fail
-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
-rem the _cmd.exe /c_ return code!
-if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
-exit /b 1
-
-:mainEnd
-if "%OS%"=="Windows_NT" endlocal
-
-:omega
diff --git a/third_party/flatbuffers/android/settings.gradle b/third_party/flatbuffers/android/settings.gradle
deleted file mode 100644
index c4c0afbc9..000000000
--- a/third_party/flatbuffers/android/settings.gradle
+++ /dev/null
@@ -1,2 +0,0 @@
-include ':app'
-rootProject.name = "FlatbuffersTest"
diff --git a/third_party/flatbuffers/bazel/BUILD.bazel b/third_party/flatbuffers/bazel/BUILD.bazel
deleted file mode 100644
index e69de29bb..000000000
diff --git a/third_party/flatbuffers/benchmarks/CMakeLists.txt b/third_party/flatbuffers/benchmarks/CMakeLists.txt
deleted file mode 100644
index 18f6ef9fd..000000000
--- a/third_party/flatbuffers/benchmarks/CMakeLists.txt
+++ /dev/null
@@ -1,88 +0,0 @@
-# Setup for running Google Benchmarks (https://github.com/google/benchmark) on
-# flatbuffers. This requires both that benchmark library and its dependency gtest
-# to build. Instead of including them here or doing a submodule, this uses
-# FetchContent (https://cmake.org/cmake/help/latest/module/FetchContent.html) to
-# grab the dependencies at config time. This requires CMake 3.14 or higher.
-
-cmake_minimum_required(VERSION 3.14)
-include(FetchContent)
-
-# No particular reason for the specific GIT_TAGs for the following repos, they
-# were just the latest releases when this was added.
-FetchContent_Declare(
- googletest
- GIT_REPOSITORY https://github.com/google/googletest.git
- GIT_TAG e2239ee6043f73722e7aa812a459f54a28552929 # release-1.11.0
-)
-FetchContent_Declare(
- googlebenchmark
- GIT_REPOSITORY https://github.com/google/benchmark.git
- GIT_TAG 0d98dba29d66e93259db7daa53a9327df767a415 # v1.6.1
-)
-
-# For Windows: Prevent overriding the parent project's compiler/linker
-# settings.
-set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
-FetchContent_MakeAvailable(
- googletest
- googlebenchmark
-)
-
-set(CPP_BENCH_DIR ${CMAKE_CURRENT_SOURCE_DIR}/cpp)
-set(CPP_FB_BENCH_DIR ${CPP_BENCH_DIR}/flatbuffers)
-set(CPP_RAW_BENCH_DIR ${CPP_BENCH_DIR}/raw)
-set(CPP_BENCH_FBS ${CPP_FB_BENCH_DIR}/bench.fbs)
-set(CPP_BENCH_FB_GEN ${CPP_FB_BENCH_DIR}/bench_generated.h)
-
-set(FlatBenchmark_SRCS
- ${CPP_BENCH_DIR}/benchmark_main.cpp
- ${CPP_FB_BENCH_DIR}/fb_bench.cpp
- ${CPP_RAW_BENCH_DIR}/raw_bench.cpp
- ${CPP_BENCH_FB_GEN}
-)
-
-# Generate the flatbuffers benchmark code from the flatbuffers schema using
-# flatc itself, thus it depends on flatc. This also depends on the C++ runtime
-# flatbuffers and the schema file itself, so it should auto-generated at the
-# correct times.
-add_custom_command(
- OUTPUT ${CPP_BENCH_FB_GEN}
- COMMAND
- "${FLATBUFFERS_FLATC_EXECUTABLE}"
- --cpp
- -o ${CPP_FB_BENCH_DIR}
- ${CPP_BENCH_FBS}
- DEPENDS
- flatc
- flatbuffers
- ${CPP_BENCH_FBS}
- COMMENT "Run Flatbuffers Benchmark Codegen: ${CPP_BENCH_FB_GEN}"
- VERBATIM)
-
-# The main flatbuffers benchmark executable
-add_executable(flatbenchmark ${FlatBenchmark_SRCS})
-
-# Benchmark requires C++11
-target_compile_features(flatbenchmark PRIVATE
- cxx_std_11 # requires cmake 3.8
-)
-
-target_compile_options(flatbenchmark
- PRIVATE
- -fno-aligned-new
- -Wno-deprecated-declarations
-)
-
-# Set the output directory to the root binary directory
-set_target_properties(flatbenchmark
- PROPERTIES RUNTIME_OUTPUT_DIRECTORY
- "${CMAKE_BINARY_DIR}"
-)
-
-# The includes of the benchmark files are fully qualified from flatbuffers root.
-target_include_directories(flatbenchmark PUBLIC ${CMAKE_SOURCE_DIR})
-
-target_link_libraries(flatbenchmark PRIVATE
- benchmark::benchmark_main # _main to use their entry point
- gtest # Link to gtest so we can also assert in the benchmarks
-)
\ No newline at end of file
diff --git a/third_party/flatbuffers/benchmarks/cpp/bench.h b/third_party/flatbuffers/benchmarks/cpp/bench.h
deleted file mode 100644
index ad4baebf5..000000000
--- a/third_party/flatbuffers/benchmarks/cpp/bench.h
+++ /dev/null
@@ -1,19 +0,0 @@
-#ifndef BENCHMARKS_CPP_BENCH_H_
-#define BENCHMARKS_CPP_BENCH_H_
-
-#include
-
-struct Bench {
- virtual ~Bench() {}
-
- inline void Add(int64_t value) { sum += value; }
-
- virtual uint8_t *Encode(void *buf, int64_t &len) = 0;
- virtual void *Decode(void *buf, int64_t len) = 0;
- virtual int64_t Use(void *decoded) = 0;
- virtual void Dealloc(void *decoded) = 0;
-
- int64_t sum = 0;
-};
-
-#endif // BENCHMARKS_CPP_BENCH_H_
\ No newline at end of file
diff --git a/third_party/flatbuffers/benchmarks/cpp/benchmark_main.cpp b/third_party/flatbuffers/benchmarks/cpp/benchmark_main.cpp
deleted file mode 100644
index 63807a5dd..000000000
--- a/third_party/flatbuffers/benchmarks/cpp/benchmark_main.cpp
+++ /dev/null
@@ -1,96 +0,0 @@
-#include
-#include
-
-#include "benchmarks/cpp/bench.h"
-#include "benchmarks/cpp/flatbuffers/fb_bench.h"
-#include "benchmarks/cpp/raw/raw_bench.h"
-
-static inline void Encode(benchmark::State &state,
- std::unique_ptr &bench, uint8_t *buffer) {
- int64_t length;
- for (auto _ : state) {
- bench->Encode(buffer, length);
- benchmark::DoNotOptimize(length);
- }
-}
-
-static inline void Decode(benchmark::State &state,
- std::unique_ptr &bench, uint8_t *buffer) {
- int64_t length;
- uint8_t *encoded = bench->Encode(buffer, length);
-
- for (auto _ : state) {
- void *decoded = bench->Decode(encoded, length);
- benchmark::DoNotOptimize(decoded);
- }
-}
-
-static inline void Use(benchmark::State &state, std::unique_ptr &bench,
- uint8_t *buffer, int64_t check_sum) {
- int64_t length;
- uint8_t *encoded = bench->Encode(buffer, length);
- void *decoded = bench->Decode(encoded, length);
-
- int64_t sum = 0;
-
- for (auto _ : state) { sum = bench->Use(decoded); }
-
- EXPECT_EQ(sum, check_sum);
-}
-
-static void BM_Flatbuffers_Encode(benchmark::State &state) {
- const int64_t kBufferLength = 1024;
- uint8_t buffer[kBufferLength];
-
- StaticAllocator allocator(&buffer[0]);
- std::unique_ptr bench = NewFlatBuffersBench(kBufferLength, &allocator);
- Encode(state, bench, buffer);
-}
-BENCHMARK(BM_Flatbuffers_Encode);
-
-static void BM_Flatbuffers_Decode(benchmark::State &state) {
- const int64_t kBufferLength = 1024;
- uint8_t buffer[kBufferLength];
-
- StaticAllocator allocator(&buffer[0]);
- std::unique_ptr bench = NewFlatBuffersBench(kBufferLength, &allocator);
- Decode(state, bench, buffer);
-}
-BENCHMARK(BM_Flatbuffers_Decode);
-
-static void BM_Flatbuffers_Use(benchmark::State &state) {
- const int64_t kBufferLength = 1024;
- uint8_t buffer[kBufferLength];
-
- StaticAllocator allocator(&buffer[0]);
- std::unique_ptr bench = NewFlatBuffersBench(kBufferLength, &allocator);
- Use(state, bench, buffer, 218812692406581874);
-}
-BENCHMARK(BM_Flatbuffers_Use);
-
-static void BM_Raw_Encode(benchmark::State &state) {
- const int64_t kBufferLength = 1024;
- uint8_t buffer[kBufferLength];
-
- std::unique_ptr bench = NewRawBench();
- Encode(state, bench, buffer);
-}
-BENCHMARK(BM_Raw_Encode);
-
-static void BM_Raw_Decode(benchmark::State &state) {
- const int64_t kBufferLength = 1024;
- uint8_t buffer[kBufferLength];
-
- std::unique_ptr bench = NewRawBench();
- Decode(state, bench, buffer);
-}
-BENCHMARK(BM_Raw_Decode);
-
-static void BM_Raw_Use(benchmark::State &state) {
- const int64_t kBufferLength = 1024;
- uint8_t buffer[kBufferLength];
-
- std::unique_ptr bench = NewRawBench();
- Use(state, bench, buffer, 218812692406581874);
-}
-BENCHMARK(BM_Raw_Use);
diff --git a/third_party/flatbuffers/benchmarks/cpp/flatbuffers/bench.fbs b/third_party/flatbuffers/benchmarks/cpp/flatbuffers/bench.fbs
deleted file mode 100644
index 8e5f3ff7e..000000000
--- a/third_party/flatbuffers/benchmarks/cpp/flatbuffers/bench.fbs
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright 2021 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.
-
-
-// trying to represent a typical mix of datatypes:
-// 1 array of 3 elements, each element: 1 string, 3 nested objects, 9 scalars
-// root element has the array, additional string and an enum
-
-namespace benchmarks_flatbuffers;
-
-enum Enum : short { Apples, Pears, Bananas}
-
-struct Foo {
- id:ulong;
- count:short;
- prefix:byte;
- length:uint;
-}
-
-struct Bar {
- parent:Foo;
- time:int;
- ratio:float;
- size:ushort;
-}
-
-table FooBar {
- sibling:Bar;
- name:string;
- rating:double;
- postfix:ubyte;
-}
-
-table FooBarContainer {
- list:[FooBar]; // 3 copies of the above
- initialized:bool;
- fruit:Enum;
- location:string;
-}
-
-root_type FooBarContainer;
diff --git a/third_party/flatbuffers/benchmarks/cpp/flatbuffers/bench_generated.h b/third_party/flatbuffers/benchmarks/cpp/flatbuffers/bench_generated.h
deleted file mode 100644
index 8293759aa..000000000
--- a/third_party/flatbuffers/benchmarks/cpp/flatbuffers/bench_generated.h
+++ /dev/null
@@ -1,354 +0,0 @@
-// automatically generated by the FlatBuffers compiler, do not modify
-
-
-#ifndef FLATBUFFERS_GENERATED_BENCH_BENCHMARKS_FLATBUFFERS_H_
-#define FLATBUFFERS_GENERATED_BENCH_BENCHMARKS_FLATBUFFERS_H_
-
-#include "flatbuffers/flatbuffers.h"
-
-// Ensure the included flatbuffers.h is the same version as when this file was
-// generated, otherwise it may not be compatible.
-static_assert(FLATBUFFERS_VERSION_MAJOR == 2 &&
- FLATBUFFERS_VERSION_MINOR == 0 &&
- FLATBUFFERS_VERSION_REVISION == 6,
- "Non-compatible flatbuffers version included");
-
-namespace benchmarks_flatbuffers {
-
-struct Foo;
-
-struct Bar;
-
-struct FooBar;
-struct FooBarBuilder;
-
-struct FooBarContainer;
-struct FooBarContainerBuilder;
-
-enum Enum : int16_t {
- Enum_Apples = 0,
- Enum_Pears = 1,
- Enum_Bananas = 2,
- Enum_MIN = Enum_Apples,
- Enum_MAX = Enum_Bananas
-};
-
-inline const Enum (&EnumValuesEnum())[3] {
- static const Enum values[] = {
- Enum_Apples,
- Enum_Pears,
- Enum_Bananas
- };
- return values;
-}
-
-inline const char * const *EnumNamesEnum() {
- static const char * const names[4] = {
- "Apples",
- "Pears",
- "Bananas",
- nullptr
- };
- return names;
-}
-
-inline const char *EnumNameEnum(Enum e) {
- if (flatbuffers::IsOutRange(e, Enum_Apples, Enum_Bananas)) return "";
- const size_t index = static_cast(e);
- return EnumNamesEnum()[index];
-}
-
-FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) Foo FLATBUFFERS_FINAL_CLASS {
- private:
- uint64_t id_;
- int16_t count_;
- int8_t prefix_;
- int8_t padding0__;
- uint32_t length_;
-
- public:
- Foo()
- : id_(0),
- count_(0),
- prefix_(0),
- padding0__(0),
- length_(0) {
- (void)padding0__;
- }
- Foo(uint64_t _id, int16_t _count, int8_t _prefix, uint32_t _length)
- : id_(flatbuffers::EndianScalar(_id)),
- count_(flatbuffers::EndianScalar(_count)),
- prefix_(flatbuffers::EndianScalar(_prefix)),
- padding0__(0),
- length_(flatbuffers::EndianScalar(_length)) {
- (void)padding0__;
- }
- uint64_t id() const {
- return flatbuffers::EndianScalar(id_);
- }
- int16_t count() const {
- return flatbuffers::EndianScalar(count_);
- }
- int8_t prefix() const {
- return flatbuffers::EndianScalar(prefix_);
- }
- uint32_t length() const {
- return flatbuffers::EndianScalar(length_);
- }
-};
-FLATBUFFERS_STRUCT_END(Foo, 16);
-
-FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) Bar FLATBUFFERS_FINAL_CLASS {
- private:
- benchmarks_flatbuffers::Foo parent_;
- int32_t time_;
- float ratio_;
- uint16_t size_;
- int16_t padding0__; int32_t padding1__;
-
- public:
- Bar()
- : parent_(),
- time_(0),
- ratio_(0),
- size_(0),
- padding0__(0),
- padding1__(0) {
- (void)padding0__;
- (void)padding1__;
- }
- Bar(const benchmarks_flatbuffers::Foo &_parent, int32_t _time, float _ratio, uint16_t _size)
- : parent_(_parent),
- time_(flatbuffers::EndianScalar(_time)),
- ratio_(flatbuffers::EndianScalar(_ratio)),
- size_(flatbuffers::EndianScalar(_size)),
- padding0__(0),
- padding1__(0) {
- (void)padding0__;
- (void)padding1__;
- }
- const benchmarks_flatbuffers::Foo &parent() const {
- return parent_;
- }
- int32_t time() const {
- return flatbuffers::EndianScalar(time_);
- }
- float ratio() const {
- return flatbuffers::EndianScalar(ratio_);
- }
- uint16_t size() const {
- return flatbuffers::EndianScalar(size_);
- }
-};
-FLATBUFFERS_STRUCT_END(Bar, 32);
-
-struct FooBar FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
- typedef FooBarBuilder Builder;
- enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
- VT_SIBLING = 4,
- VT_NAME = 6,
- VT_RATING = 8,
- VT_POSTFIX = 10
- };
- const benchmarks_flatbuffers::Bar *sibling() const {
- return GetStruct(VT_SIBLING);
- }
- const flatbuffers::String *name() const {
- return GetPointer(VT_NAME);
- }
- double rating() const {
- return GetField(VT_RATING, 0.0);
- }
- uint8_t postfix() const {
- return GetField(VT_POSTFIX, 0);
- }
- bool Verify(flatbuffers::Verifier &verifier) const {
- return VerifyTableStart(verifier) &&
- VerifyField(verifier, VT_SIBLING, 8) &&
- VerifyOffset(verifier, VT_NAME) &&
- verifier.VerifyString(name()) &&
- VerifyField(verifier, VT_RATING, 8) &&
- VerifyField(verifier, VT_POSTFIX, 1) &&
- verifier.EndTable();
- }
-};
-
-struct FooBarBuilder {
- typedef FooBar Table;
- flatbuffers::FlatBufferBuilder &fbb_;
- flatbuffers::uoffset_t start_;
- void add_sibling(const benchmarks_flatbuffers::Bar *sibling) {
- fbb_.AddStruct(FooBar::VT_SIBLING, sibling);
- }
- void add_name(flatbuffers::Offset name) {
- fbb_.AddOffset(FooBar::VT_NAME, name);
- }
- void add_rating(double rating) {
- fbb_.AddElement(FooBar::VT_RATING, rating, 0.0);
- }
- void add_postfix(uint8_t postfix) {
- fbb_.AddElement(FooBar::VT_POSTFIX, postfix, 0);
- }
- explicit FooBarBuilder(flatbuffers::FlatBufferBuilder &_fbb)
- : fbb_(_fbb) {
- start_ = fbb_.StartTable();
- }
- flatbuffers::Offset Finish() {
- const auto end = fbb_.EndTable(start_);
- auto o = flatbuffers::Offset(end);
- return o;
- }
-};
-
-inline flatbuffers::Offset CreateFooBar(
- flatbuffers::FlatBufferBuilder &_fbb,
- const benchmarks_flatbuffers::Bar *sibling = nullptr,
- flatbuffers::Offset name = 0,
- double rating = 0.0,
- uint8_t postfix = 0) {
- FooBarBuilder builder_(_fbb);
- builder_.add_rating(rating);
- builder_.add_name(name);
- builder_.add_sibling(sibling);
- builder_.add_postfix(postfix);
- return builder_.Finish();
-}
-
-inline flatbuffers::Offset CreateFooBarDirect(
- flatbuffers::FlatBufferBuilder &_fbb,
- const benchmarks_flatbuffers::Bar *sibling = nullptr,
- const char *name = nullptr,
- double rating = 0.0,
- uint8_t postfix = 0) {
- auto name__ = name ? _fbb.CreateString(name) : 0;
- return benchmarks_flatbuffers::CreateFooBar(
- _fbb,
- sibling,
- name__,
- rating,
- postfix);
-}
-
-struct FooBarContainer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
- typedef FooBarContainerBuilder Builder;
- enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
- VT_LIST = 4,
- VT_INITIALIZED = 6,
- VT_FRUIT = 8,
- VT_LOCATION = 10
- };
- const flatbuffers::Vector> *list() const {
- return GetPointer> *>(VT_LIST);
- }
- bool initialized() const {
- return GetField(VT_INITIALIZED, 0) != 0;
- }
- benchmarks_flatbuffers::Enum fruit() const {
- return static_cast(GetField(VT_FRUIT, 0));
- }
- const flatbuffers::String *location() const {
- return GetPointer(VT_LOCATION);
- }
- bool Verify(flatbuffers::Verifier &verifier) const {
- return VerifyTableStart(verifier) &&
- VerifyOffset(verifier, VT_LIST) &&
- verifier.VerifyVector(list()) &&
- verifier.VerifyVectorOfTables(list()) &&
- VerifyField(verifier, VT_INITIALIZED, 1) &&
- VerifyField(verifier, VT_FRUIT, 2) &&
- VerifyOffset(verifier, VT_LOCATION) &&
- verifier.VerifyString(location()) &&
- verifier.EndTable();
- }
-};
-
-struct FooBarContainerBuilder {
- typedef FooBarContainer Table;
- flatbuffers::FlatBufferBuilder &fbb_;
- flatbuffers::uoffset_t start_;
- void add_list(flatbuffers::Offset>> list) {
- fbb_.AddOffset(FooBarContainer::VT_LIST, list);
- }
- void add_initialized(bool initialized) {
- fbb_.AddElement(FooBarContainer::VT_INITIALIZED, static_cast(initialized), 0);
- }
- void add_fruit(benchmarks_flatbuffers::Enum fruit) {
- fbb_.AddElement(FooBarContainer::VT_FRUIT, static_cast(fruit), 0);
- }
- void add_location(flatbuffers::Offset location) {
- fbb_.AddOffset(FooBarContainer::VT_LOCATION, location);
- }
- explicit FooBarContainerBuilder(flatbuffers::FlatBufferBuilder &_fbb)
- : fbb_(_fbb) {
- start_ = fbb_.StartTable();
- }
- flatbuffers::Offset Finish() {
- const auto end = fbb_.EndTable(start_);
- auto o = flatbuffers::Offset(end);
- return o;
- }
-};
-
-inline flatbuffers::Offset CreateFooBarContainer(
- flatbuffers::FlatBufferBuilder &_fbb,
- flatbuffers::Offset>> list = 0,
- bool initialized = false,
- benchmarks_flatbuffers::Enum fruit = benchmarks_flatbuffers::Enum_Apples,
- flatbuffers::Offset location = 0) {
- FooBarContainerBuilder builder_(_fbb);
- builder_.add_location(location);
- builder_.add_list(list);
- builder_.add_fruit(fruit);
- builder_.add_initialized(initialized);
- return builder_.Finish();
-}
-
-inline flatbuffers::Offset CreateFooBarContainerDirect(
- flatbuffers::FlatBufferBuilder &_fbb,
- const std::vector> *list = nullptr,
- bool initialized = false,
- benchmarks_flatbuffers::Enum fruit = benchmarks_flatbuffers::Enum_Apples,
- const char *location = nullptr) {
- auto list__ = list ? _fbb.CreateVector>(*list) : 0;
- auto location__ = location ? _fbb.CreateString(location) : 0;
- return benchmarks_flatbuffers::CreateFooBarContainer(
- _fbb,
- list__,
- initialized,
- fruit,
- location__);
-}
-
-inline const benchmarks_flatbuffers::FooBarContainer *GetFooBarContainer(const void *buf) {
- return flatbuffers::GetRoot(buf);
-}
-
-inline const benchmarks_flatbuffers::FooBarContainer *GetSizePrefixedFooBarContainer(const void *buf) {
- return flatbuffers::GetSizePrefixedRoot(buf);
-}
-
-inline bool VerifyFooBarContainerBuffer(
- flatbuffers::Verifier &verifier) {
- return verifier.VerifyBuffer(nullptr);
-}
-
-inline bool VerifySizePrefixedFooBarContainerBuffer(
- flatbuffers::Verifier &verifier) {
- return verifier.VerifySizePrefixedBuffer(nullptr);
-}
-
-inline void FinishFooBarContainerBuffer(
- flatbuffers::FlatBufferBuilder &fbb,
- flatbuffers::Offset root) {
- fbb.Finish(root);
-}
-
-inline void FinishSizePrefixedFooBarContainerBuffer(
- flatbuffers::FlatBufferBuilder &fbb,
- flatbuffers::Offset root) {
- fbb.FinishSizePrefixed(root);
-}
-
-} // namespace benchmarks_flatbuffers
-
-#endif // FLATBUFFERS_GENERATED_BENCH_BENCHMARKS_FLATBUFFERS_H_
diff --git a/third_party/flatbuffers/benchmarks/cpp/flatbuffers/fb_bench.cpp b/third_party/flatbuffers/benchmarks/cpp/flatbuffers/fb_bench.cpp
deleted file mode 100644
index 935166745..000000000
--- a/third_party/flatbuffers/benchmarks/cpp/flatbuffers/fb_bench.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-#include "benchmarks/cpp/flatbuffers/fb_bench.h"
-
-#include
-#include
-
-#include "benchmarks/cpp/bench.h"
-#include "benchmarks/cpp/flatbuffers/bench_generated.h"
-#include "flatbuffers/flatbuffers.h"
-
-using namespace flatbuffers;
-using namespace benchmarks_flatbuffers;
-
-namespace {
-
-struct FlatBufferBench : Bench {
- explicit FlatBufferBench(int64_t initial_size, Allocator *allocator)
- : fbb(initial_size, allocator, false) {}
-
- uint8_t *Encode(void *, int64_t &len) override {
- fbb.Clear();
-
- const int kVectorLength = 3;
- Offset vec[kVectorLength];
-
- for (int i = 0; i < kVectorLength; ++i) {
- Foo foo(0xABADCAFEABADCAFE + i, 10000 + i, '@' + i, 1000000 + i);
- Bar bar(foo, 123456 + i, 3.14159f + i, 10000 + i);
- auto name = fbb.CreateString("Hello, World!");
- auto foobar =
- CreateFooBar(fbb, &bar, name, 3.1415432432445543543 + i, '!' + i);
- vec[i] = foobar;
- }
- auto location = fbb.CreateString("http://google.com/flatbuffers/");
- auto foobarvec = fbb.CreateVector(vec, kVectorLength);
- auto foobarcontainer =
- CreateFooBarContainer(fbb, foobarvec, true, Enum_Bananas, location);
- fbb.Finish(foobarcontainer);
-
- len = fbb.GetSize();
- return fbb.GetBufferPointer();
- }
-
- int64_t Use(void *decoded) override {
- sum = 0;
- auto foobarcontainer = GetFooBarContainer(decoded);
- sum = 0;
- Add(foobarcontainer->initialized());
- Add(foobarcontainer->location()->Length());
- Add(foobarcontainer->fruit());
- for (unsigned int i = 0; i < foobarcontainer->list()->Length(); i++) {
- auto foobar = foobarcontainer->list()->Get(i);
- Add(foobar->name()->Length());
- Add(foobar->postfix());
- Add(static_cast(foobar->rating()));
- auto bar = foobar->sibling();
- Add(static_cast(bar->ratio()));
- Add(bar->size());
- Add(bar->time());
- auto &foo = bar->parent();
- Add(foo.count());
- Add(foo.id());
- Add(foo.length());
- Add(foo.prefix());
- }
- return sum;
- }
-
- void *Decode(void *buffer, int64_t) override { return buffer; }
- void Dealloc(void *) override {};
-
- FlatBufferBuilder fbb;
-};
-
-} // namespace
-
-std::unique_ptr NewFlatBuffersBench(int64_t initial_size,
- Allocator *allocator) {
- return std::unique_ptr(
- new FlatBufferBench(initial_size, allocator));
-}
diff --git a/third_party/flatbuffers/benchmarks/cpp/flatbuffers/fb_bench.h b/third_party/flatbuffers/benchmarks/cpp/flatbuffers/fb_bench.h
deleted file mode 100644
index ffb5f54c1..000000000
--- a/third_party/flatbuffers/benchmarks/cpp/flatbuffers/fb_bench.h
+++ /dev/null
@@ -1,23 +0,0 @@
-#ifndef BENCHMARKS_CPP_FLATBUFFERS_FB_BENCH_H_
-#define BENCHMARKS_CPP_FLATBUFFERS_FB_BENCH_H_
-
-#include
-#include
-
-#include "benchmarks/cpp/bench.h"
-#include "include/flatbuffers/flatbuffers.h"
-
-struct StaticAllocator : public flatbuffers::Allocator {
- explicit StaticAllocator(uint8_t *buffer) : buffer_(buffer) {}
-
- uint8_t *allocate(size_t) override { return buffer_; }
-
- void deallocate(uint8_t *, size_t) override {}
-
- uint8_t *buffer_;
-};
-
-std::unique_ptr NewFlatBuffersBench(
- int64_t initial_size = 1024, flatbuffers::Allocator *allocator = nullptr);
-
-#endif // BENCHMARKS_CPP_FLATBUFFERS_FB_BENCH_H_
\ No newline at end of file
diff --git a/third_party/flatbuffers/benchmarks/cpp/raw/raw_bench.cpp b/third_party/flatbuffers/benchmarks/cpp/raw/raw_bench.cpp
deleted file mode 100644
index c65bca7f7..000000000
--- a/third_party/flatbuffers/benchmarks/cpp/raw/raw_bench.cpp
+++ /dev/null
@@ -1,109 +0,0 @@
-#include "benchmarks/cpp/raw/raw_bench.h"
-
-#include
-#include
-#include
-
-#include "benchmarks/cpp/bench.h"
-
-namespace {
-const int64_t kStringLength = 32;
-const int64_t kVectorLength = 3;
-
-enum Enum { Apples, Pears, Bananas };
-
-struct Foo {
- int64_t id;
- short count;
- char prefix;
- int length;
-};
-
-struct Bar {
- Foo parent;
- int time;
- float ratio;
- unsigned short size;
-};
-
-struct FooBar {
- Bar sibling;
- // We have to stick this in, otherwise strlen() will make it slower than
- // FlatBuffers:
- int name_len;
- char name[kStringLength];
- double rating;
- unsigned char postfix;
-};
-
-struct FooBarContainer {
- FooBar list[kVectorLength]; // 3 copies of the above
- bool initialized;
- Enum fruit;
- int location_len;
- char location[kStringLength];
-};
-
-struct RawBench : Bench {
- uint8_t *Encode(void *buf, int64_t &len) override {
- FooBarContainer *fbc = new (buf) FooBarContainer;
- strcpy(fbc->location, "http://google.com/flatbuffers/"); // Unsafe eek!
- fbc->location_len = (int)strlen(fbc->location);
- fbc->fruit = Bananas;
- fbc->initialized = true;
- for (int i = 0; i < kVectorLength; i++) {
- // We add + i to not make these identical copies for a more realistic
- // compression test.
- auto &foobar = fbc->list[i];
- foobar.rating = 3.1415432432445543543 + i;
- foobar.postfix = '!' + i;
- strcpy(foobar.name, "Hello, World!");
- foobar.name_len = (int)strlen(foobar.name);
- auto &bar = foobar.sibling;
- bar.ratio = 3.14159f + i;
- bar.size = 10000 + i;
- bar.time = 123456 + i;
- auto &foo = bar.parent;
- foo.id = 0xABADCAFEABADCAFE + i;
- foo.count = 10000 + i;
- foo.length = 1000000 + i;
- foo.prefix = '@' + i;
- }
-
- len = sizeof(FooBarContainer);
- return reinterpret_cast(fbc);
- };
-
- int64_t Use(void *decoded) override {
- auto foobarcontainer = reinterpret_cast(decoded);
- sum = 0;
- Add(foobarcontainer->initialized);
- Add(foobarcontainer->location_len);
- Add(foobarcontainer->fruit);
- for (unsigned int i = 0; i < kVectorLength; i++) {
- auto foobar = &foobarcontainer->list[i];
- Add(foobar->name_len);
- Add(foobar->postfix);
- Add(static_cast(foobar->rating));
- auto bar = &foobar->sibling;
- Add(static_cast(bar->ratio));
- Add(bar->size);
- Add(bar->time);
- auto &foo = bar->parent;
- Add(foo.count);
- Add(foo.id);
- Add(foo.length);
- Add(foo.prefix);
- }
- return sum;
- }
-
- void *Decode(void *buf, int64_t) override { return buf; }
- void Dealloc(void *) override{};
-};
-
-} // namespace
-
-std::unique_ptr NewRawBench() {
- return std::unique_ptr(new RawBench());
-}
diff --git a/third_party/flatbuffers/benchmarks/cpp/raw/raw_bench.h b/third_party/flatbuffers/benchmarks/cpp/raw/raw_bench.h
deleted file mode 100644
index 68bb278c2..000000000
--- a/third_party/flatbuffers/benchmarks/cpp/raw/raw_bench.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef BENCHMARKS_CPP_RAW_RAW_BENCH_H_
-#define BENCHMARKS_CPP_RAW_RAW_BENCH_H_
-
-#include
-
-#include "benchmarks/cpp/bench.h"
-
-std::unique_ptr NewRawBench();
-
-#endif // BENCHMARKS_CPP_RAW_RAW_BENCH_H_
\ No newline at end of file
diff --git a/third_party/flatbuffers/benchmarks/swift/Benchmarks/FlatbuffersBenchmarks/FlatbuffersBenchmarks.swift b/third_party/flatbuffers/benchmarks/swift/Benchmarks/FlatbuffersBenchmarks/FlatbuffersBenchmarks.swift
deleted file mode 100644
index 902ff475a..000000000
--- a/third_party/flatbuffers/benchmarks/swift/Benchmarks/FlatbuffersBenchmarks/FlatbuffersBenchmarks.swift
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * Copyright 2023 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.
- */
-
-import Benchmark
-import CoreFoundation
-import FlatBuffers
-
-@usableFromInline
-struct AA: NativeStruct {
- public init(a: Double, b: Double) {
- self.a = a
- self.b = b
- }
- var a: Double
- var b: Double
-}
-
-let benchmarks = {
- let ints: [Int] = Array(repeating: 42, count: 100)
- let bytes: [UInt8] = Array(repeating: 42, count: 100)
- let str10 = (0...9).map { _ -> String in "x" }.joined()
- let str100 = (0...99).map { _ -> String in "x" }.joined()
- let array: [AA] = [
- AA(a: 2.4, b: 2.4),
- AA(a: 2.4, b: 2.4),
- AA(a: 2.4, b: 2.4),
- AA(a: 2.4, b: 2.4),
- AA(a: 2.4, b: 2.4),
- ]
-
- let metrics: [BenchmarkMetric] = [
- .cpuTotal,
- .wallClock,
- .mallocCountTotal,
- .releaseCount,
- .peakMemoryResident,
- ]
- let maxIterations = 1_000_000
- let maxDuration: Duration = .seconds(3)
- let singleConfiguration: Benchmark.Configuration = .init(
- metrics: metrics,
- warmupIterations: 1,
- scalingFactor: .one,
- maxDuration: maxDuration,
- maxIterations: maxIterations)
- let kiloConfiguration: Benchmark.Configuration = .init(
- metrics: metrics,
- warmupIterations: 1,
- scalingFactor: .kilo,
- maxDuration: maxDuration,
- maxIterations: maxIterations)
- let megaConfiguration: Benchmark.Configuration = .init(
- metrics: metrics,
- warmupIterations: 1,
- scalingFactor: .mega,
- maxDuration: maxDuration,
- maxIterations: maxIterations)
-
- Benchmark.defaultConfiguration = megaConfiguration
-
- Benchmark("Allocating 1GB", configuration: singleConfiguration) { benchmark in
- for _ in benchmark.scaledIterations {
- blackHole(FlatBufferBuilder(initialSize: 1_024_000_000))
- }
- }
-
- Benchmark("Clearing 1GB", configuration: singleConfiguration) { benchmark in
- var fb = FlatBufferBuilder(initialSize: 1_024_000_000)
- benchmark.startMeasurement()
- for _ in benchmark.scaledIterations {
- blackHole(fb.clear())
- }
- }
-
- Benchmark("Strings 10") { benchmark in
- var fb = FlatBufferBuilder(initialSize: 1<<20)
- benchmark.startMeasurement()
- for _ in benchmark.scaledIterations {
- blackHole(fb.create(string: str10))
- }
- }
-
- Benchmark("Strings 100") { benchmark in
- var fb = FlatBufferBuilder(initialSize: 1<<20)
- benchmark.startMeasurement()
- for _ in benchmark.scaledIterations {
- blackHole(fb.create(string: str100))
- }
- }
-
- Benchmark("Vector 1 Bytes") { benchmark in
- var fb = FlatBufferBuilder(initialSize: 1<<20)
- benchmark.startMeasurement()
- for _ in benchmark.scaledIterations {
- blackHole(fb.createVector(bytes: bytes))
- }
- }
-
- Benchmark("Vector 1 Ints") { benchmark in
- var fb = FlatBufferBuilder(initialSize: 1<<20)
- benchmark.startMeasurement()
- for _ in benchmark.scaledIterations {
- blackHole(fb.createVector(ints))
- }
- }
-
- Benchmark("Vector 100 Ints") { benchmark in
- var fb = FlatBufferBuilder(initialSize: 1<<20)
- benchmark.startMeasurement()
- for i in benchmark.scaledIterations {
- blackHole(fb.createVector(ints))
- }
- }
-
- Benchmark("Vector 100 Bytes") { benchmark in
- var fb = FlatBufferBuilder(initialSize: 1<<20)
- benchmark.startMeasurement()
- for i in benchmark.scaledIterations {
- blackHole(fb.createVector(bytes))
- }
- }
-
- Benchmark("Vector 100 ContiguousBytes") { benchmark in
- var fb = FlatBufferBuilder(initialSize: 1<<20)
- benchmark.startMeasurement()
- for i in benchmark.scaledIterations {
- blackHole(fb.createVector(bytes: bytes))
- }
- }
-
- Benchmark(
- "FlatBufferBuilder Add",
- configuration: kiloConfiguration)
- { benchmark in
- var fb = FlatBufferBuilder(initialSize: 1024 * 1024 * 32)
- benchmark.startMeasurement()
- for _ in benchmark.scaledIterations {
- let off = fb.create(string: "T")
- let s = fb.startTable(with: 4)
- fb.add(element: 3.2, def: 0, at: 2)
- fb.add(element: 4.2, def: 0, at: 4)
- fb.add(element: 5.2, def: 0, at: 6)
- fb.add(offset: off, at: 8)
- blackHole(fb.endTable(at: s))
- }
- }
-
- Benchmark("Structs") { benchmark in
- let rawSize = ((16 * 5) * benchmark.scaledIterations.count) / 1024
- var fb = FlatBufferBuilder(initialSize: Int32(rawSize * 1600))
- var offsets: [Offset] = []
-
- benchmark.startMeasurement()
- for _ in benchmark.scaledIterations {
- let vector = fb.createVector(
- ofStructs: array)
- let start = fb.startTable(with: 1)
- fb.add(offset: vector, at: 4)
- offsets.append(Offset(offset: fb.endTable(at: start)))
- }
-
- let vector = fb.createVector(ofOffsets: offsets)
- let start = fb.startTable(with: 1)
- fb.add(offset: vector, at: 4)
- let root = Offset(offset: fb.endTable(at: start))
- fb.finish(offset: root)
- }
-}
diff --git a/third_party/flatbuffers/benchmarks/swift/Package.swift b/third_party/flatbuffers/benchmarks/swift/Package.swift
deleted file mode 100644
index 4204c4813..000000000
--- a/third_party/flatbuffers/benchmarks/swift/Package.swift
+++ /dev/null
@@ -1,42 +0,0 @@
-// swift-tools-version:5.8
-/*
- * Copyright 2020 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.
- */
-
-import PackageDescription
-
-let package = Package(
- name: "benchmarks",
- platforms: [
- .macOS(.v13),
- ],
- dependencies: [
- .package(path: "../.."),
- .package(
- url: "https://github.com/ordo-one/package-benchmark",
- from: "1.12.0"),
- ],
- targets: [
- .executableTarget(
- name: "FlatbuffersBenchmarks",
- dependencies: [
- .product(name: "FlatBuffers", package: "flatbuffers"),
- .product(name: "Benchmark", package: "package-benchmark"),
- ],
- path: "Benchmarks/FlatbuffersBenchmarks",
- plugins: [
- .plugin(name: "BenchmarkPlugin", package: "package-benchmark"),
- ]),
- ])
diff --git a/third_party/flatbuffers/benchmarks/swift/README.md b/third_party/flatbuffers/benchmarks/swift/README.md
deleted file mode 100644
index 4f95872d6..000000000
--- a/third_party/flatbuffers/benchmarks/swift/README.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# Benchmarks
-
-To open the benchmarks in xcode use:
-
-`open --env BENCHMARK_DISABLE_JEMALLOC=true Package.swift`
-
-or running them directly within terminal using:
-
-`swift package benchmark`
\ No newline at end of file
diff --git a/third_party/flatbuffers/docs/footer.html b/third_party/flatbuffers/docs/footer.html
deleted file mode 100644
index 42bc5f2b9..000000000
--- a/third_party/flatbuffers/docs/footer.html
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-