Skip to content

Commit ba90fbf

Browse files
authored
Merge branch 'master' into imprv-python-iface
2 parents ef9beb4 + 7e16302 commit ba90fbf

File tree

225 files changed

+1281
-614
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

225 files changed

+1281
-614
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,4 +156,7 @@ kotlin/**/generated
156156
MODULE.bazel.lock
157157

158158
# Ignore the generated docs
159-
docs/site
159+
docs/site
160+
161+
# Ignore generated files
162+
*.fbs.h

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@ All major or breaking changes will be documented in this file, as well as any
44
new features that should be highlighted. Minor fixes or improvements are not
55
necessarily listed.
66

7+
## [25.12.19] (December 19 2025)(https://github.com/google/flatbuffers/releases/tag/v25.12.19)
8+
9+
* [C++] Default emptry vector support (#8870)
10+
* [C++] Add --gen-absl-hash option (#8868)
11+
* [Kotlin] Upgrade to MacOS 15 (#8845)
12+
* [C++] Fix vector of table with naked ptrs (#8830)
13+
* [Python] Optimize Offset/Pad/Prep (#8808)
14+
* Implement `--file-names-only` (#8788)
15+
* [C++] Fix size verifer (#8740)
16+
717
## [25.9.23] (September 23 2025)(https://github.com/google/flatbuffers/releases/tag/v25.9.23)
818

919
* flatc: `--grpc-callback-api` flag generates C++ gRPC Callback API server `CallbackService` skeletons AND client native callback/async stubs (unary + all streaming reactor forms) (opt-in, non-breaking, issue #8596).

CMake/Version.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
set(VERSION_MAJOR 25)
2-
set(VERSION_MINOR 9)
3-
set(VERSION_PATCH 23)
2+
set(VERSION_MINOR 12)
3+
set(VERSION_PATCH 19)
44
set(VERSION_COMMIT 0)
55

66
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")

CMakeLists.txt

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,8 @@ set(FlatHash_SRCS
218218
set(FlatBuffers_Tests_SRCS
219219
${FlatBuffers_Library_SRCS}
220220
src/idl_gen_fbs.cpp
221+
tests/default_vectors_strings_test.cpp
222+
tests/default_vectors_strings_test.h
221223
tests/evolution_test.cpp
222224
tests/flexbuffers_test.cpp
223225
tests/fuzz_test.cpp
@@ -496,28 +498,34 @@ if(FLATBUFFERS_BUILD_SHAREDLIB)
496498
endif()
497499
endif()
498500

499-
function(compile_schema SRC_FBS OPT OUT_GEN_FILE)
501+
function(compile_schema SRC_FBS OPT SUFFIX OUT_GEN_FILE)
500502
get_filename_component(SRC_FBS_DIR ${SRC_FBS} PATH)
501-
string(REGEX REPLACE "\\.fbs$" "_generated.h" GEN_HEADER ${SRC_FBS})
503+
string(REGEX REPLACE "\\.fbs$" "${SUFFIX}.h" GEN_HEADER ${SRC_FBS})
502504
add_custom_command(
503505
OUTPUT ${GEN_HEADER}
504506
COMMAND "${FLATBUFFERS_FLATC_EXECUTABLE}"
505507
${OPT}
508+
--filename-suffix ${SUFFIX}
506509
-o "${SRC_FBS_DIR}"
507510
"${CMAKE_CURRENT_SOURCE_DIR}/${SRC_FBS}"
508511
DEPENDS flatc ${SRC_FBS}
509512
COMMENT "flatc generation: `${SRC_FBS}` -> `${GEN_HEADER}`"
510-
)
513+
)
511514
set(${OUT_GEN_FILE} ${GEN_HEADER} PARENT_SCOPE)
512515
endfunction()
513516

514517
function(compile_schema_for_test SRC_FBS OPT)
515-
compile_schema("${SRC_FBS}" "${OPT}" GEN_FILE)
518+
compile_schema("${SRC_FBS}" "${OPT}" "_generated" GEN_FILE)
519+
target_sources(flattests PRIVATE ${GEN_FILE})
520+
endfunction()
521+
522+
function(compile_schema_for_test_fbsh SRC_FBS OPT)
523+
compile_schema("${SRC_FBS}" "${OPT}" ".fbs" GEN_FILE)
516524
target_sources(flattests PRIVATE ${GEN_FILE})
517525
endfunction()
518526

519527
function(compile_schema_for_samples SRC_FBS OPT)
520-
compile_schema("${SRC_FBS}" "${OPT}" GEN_FILE)
528+
compile_schema("${SRC_FBS}" "${OPT}" "_generated" GEN_FILE)
521529
target_sources(flatsample PRIVATE ${GEN_FILE})
522530
endfunction()
523531

@@ -542,6 +550,7 @@ if(FLATBUFFERS_BUILD_TESTS)
542550
SET(FLATC_OPT_SCOPED_ENUMS ${FLATC_OPT_COMP};--scoped-enums)
543551

544552
compile_schema_for_test(tests/alignment_test.fbs "${FLATC_OPT_COMP}")
553+
compile_schema_for_test_fbsh(tests/default_vectors_strings_test.fbs "${FLATC_OPT_COMP}")
545554
compile_schema_for_test(tests/arrays_test.fbs "${FLATC_OPT_SCOPED_ENUMS}")
546555
compile_schema_for_test(tests/native_inline_table_test.fbs "${FLATC_OPT_COMP}")
547556
compile_schema_for_test(tests/native_type_test.fbs "${FLATC_OPT_COMP}")
@@ -571,8 +580,6 @@ if(FLATBUFFERS_BUILD_TESTS)
571580

572581
# Since flatsample has no sources, we have to explicitly set the linker lang.
573582
set_target_properties(flatsample PROPERTIES LINKER_LANGUAGE CXX)
574-
575-
compile_schema_for_samples(samples/monster.fbs "${FLATC_OPT_COMP}")
576583

577584
target_link_libraries(flatsamplebinary PRIVATE $<BUILD_INTERFACE:ProjectConfig> flatsample)
578585
target_link_libraries(flatsampletext PRIVATE $<BUILD_INTERFACE:ProjectConfig> flatsample)

FlatBuffers.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'FlatBuffers'
3-
s.version = '25.9.23'
3+
s.version = '25.12.19'
44
s.summary = 'FlatBuffers: Memory Efficient Serialization Library'
55

66
s.description = "FlatBuffers is a cross platform serialization library architected for

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module(
22
name = "flatbuffers",
3-
version = "25.9.23",
3+
version = "25.12.19",
44
compatibility_level = 1,
55
repo_name = "com_github_google_flatbuffers",
66
)

android/app/proguard-rules.pro

Lines changed: 0 additions & 21 deletions
This file was deleted.

android/app/src/main/cpp/animals.cpp

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,27 @@
1515
*/
1616

1717
#include <jni.h>
18-
#include <string>
1918
#include <search.h>
19+
20+
#include <string>
21+
2022
#include "generated/animal_generated.h"
2123

2224
using namespace com::fbs::app;
2325
using namespace flatbuffers;
2426

25-
extern "C" JNIEXPORT jbyteArray JNICALL Java_com_flatbuffers_app_MainActivity_createAnimalFromJNI(
26-
JNIEnv* env,
27-
jobject /* this */) {
28-
// create a new animal flatbuffers
29-
auto fb = FlatBufferBuilder(1024);
30-
auto tiger = CreateAnimalDirect(fb, "Tiger", "Roar", 300);
31-
fb.Finish(tiger);
27+
extern "C" JNIEXPORT jbyteArray JNICALL
28+
Java_com_flatbuffers_app_MainActivity_createAnimalFromJNI(JNIEnv* env,
29+
jobject /* this */) {
30+
// create a new animal flatbuffers
31+
auto fb = FlatBufferBuilder(1024);
32+
auto tiger = CreateAnimalDirect(fb, "Tiger", "Roar", 300);
33+
fb.Finish(tiger);
3234

33-
// copies it to a Java byte array.
34-
auto buf = reinterpret_cast<jbyte*>(fb.GetBufferPointer());
35-
int size = fb.GetSize();
36-
auto ret = env->NewByteArray(size);
37-
env->SetByteArrayRegion (ret, 0, fb.GetSize(), buf);
35+
// copies it to a Java byte array.
36+
auto buf = reinterpret_cast<jbyte*>(fb.GetBufferPointer());
37+
int size = fb.GetSize();
38+
auto ret = env->NewByteArray(size);
39+
env->SetByteArrayRegion(ret, 0, fb.GetSize(), buf);
3840
return ret;
3941
}

android/app/src/main/java/generated/com/fbs/app/Animal.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class Animal : Table() {
5858
}
5959

6060
companion object {
61-
fun validateVersion() = Constants.FLATBUFFERS_25_9_23()
61+
fun validateVersion() = Constants.FLATBUFFERS_25_12_19()
6262

6363
fun getRootAsAnimal(_bb: ByteBuffer): Animal = getRootAsAnimal(_bb, Animal())
6464

benchmarks/cpp/benchmark_main.cpp

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,40 +5,42 @@
55
#include "benchmarks/cpp/flatbuffers/fb_bench.h"
66
#include "benchmarks/cpp/raw/raw_bench.h"
77

8-
static inline void Encode(benchmark::State &state,
9-
std::unique_ptr<Bench> &bench, uint8_t *buffer) {
8+
static inline void Encode(benchmark::State& state,
9+
std::unique_ptr<Bench>& bench, uint8_t* buffer) {
1010
int64_t length;
1111
for (auto _ : state) {
1212
bench->Encode(buffer, length);
1313
benchmark::DoNotOptimize(length);
1414
}
1515
}
1616

17-
static inline void Decode(benchmark::State &state,
18-
std::unique_ptr<Bench> &bench, uint8_t *buffer) {
17+
static inline void Decode(benchmark::State& state,
18+
std::unique_ptr<Bench>& bench, uint8_t* buffer) {
1919
int64_t length;
20-
uint8_t *encoded = bench->Encode(buffer, length);
20+
uint8_t* encoded = bench->Encode(buffer, length);
2121

2222
for (auto _ : state) {
23-
void *decoded = bench->Decode(encoded, length);
23+
void* decoded = bench->Decode(encoded, length);
2424
benchmark::DoNotOptimize(decoded);
2525
}
2626
}
2727

28-
static inline void Use(benchmark::State &state, std::unique_ptr<Bench> &bench,
29-
uint8_t *buffer, int64_t check_sum) {
28+
static inline void Use(benchmark::State& state, std::unique_ptr<Bench>& bench,
29+
uint8_t* buffer, int64_t check_sum) {
3030
int64_t length;
31-
uint8_t *encoded = bench->Encode(buffer, length);
32-
void *decoded = bench->Decode(encoded, length);
31+
uint8_t* encoded = bench->Encode(buffer, length);
32+
void* decoded = bench->Decode(encoded, length);
3333

3434
int64_t sum = 0;
3535

36-
for (auto _ : state) { sum = bench->Use(decoded); }
36+
for (auto _ : state) {
37+
sum = bench->Use(decoded);
38+
}
3739

3840
EXPECT_EQ(sum, check_sum);
3941
}
4042

41-
static void BM_Flatbuffers_Encode(benchmark::State &state) {
43+
static void BM_Flatbuffers_Encode(benchmark::State& state) {
4244
const int64_t kBufferLength = 1024;
4345
uint8_t buffer[kBufferLength];
4446

@@ -48,7 +50,7 @@ static void BM_Flatbuffers_Encode(benchmark::State &state) {
4850
}
4951
BENCHMARK(BM_Flatbuffers_Encode);
5052

51-
static void BM_Flatbuffers_Decode(benchmark::State &state) {
53+
static void BM_Flatbuffers_Decode(benchmark::State& state) {
5254
const int64_t kBufferLength = 1024;
5355
uint8_t buffer[kBufferLength];
5456

@@ -58,7 +60,7 @@ static void BM_Flatbuffers_Decode(benchmark::State &state) {
5860
}
5961
BENCHMARK(BM_Flatbuffers_Decode);
6062

61-
static void BM_Flatbuffers_Use(benchmark::State &state) {
63+
static void BM_Flatbuffers_Use(benchmark::State& state) {
6264
const int64_t kBufferLength = 1024;
6365
uint8_t buffer[kBufferLength];
6466

@@ -68,7 +70,7 @@ static void BM_Flatbuffers_Use(benchmark::State &state) {
6870
}
6971
BENCHMARK(BM_Flatbuffers_Use);
7072

71-
static void BM_Raw_Encode(benchmark::State &state) {
73+
static void BM_Raw_Encode(benchmark::State& state) {
7274
const int64_t kBufferLength = 1024;
7375
uint8_t buffer[kBufferLength];
7476

@@ -77,7 +79,7 @@ static void BM_Raw_Encode(benchmark::State &state) {
7779
}
7880
BENCHMARK(BM_Raw_Encode);
7981

80-
static void BM_Raw_Decode(benchmark::State &state) {
82+
static void BM_Raw_Decode(benchmark::State& state) {
8183
const int64_t kBufferLength = 1024;
8284
uint8_t buffer[kBufferLength];
8385

@@ -86,7 +88,7 @@ static void BM_Raw_Decode(benchmark::State &state) {
8688
}
8789
BENCHMARK(BM_Raw_Decode);
8890

89-
static void BM_Raw_Use(benchmark::State &state) {
91+
static void BM_Raw_Use(benchmark::State& state) {
9092
const int64_t kBufferLength = 1024;
9193
uint8_t buffer[kBufferLength];
9294

0 commit comments

Comments
 (0)