This is an automated email from the ASF dual-hosted git repository. lidavidm pushed a commit to branch spec-1.1.0 in repository https://gitbox.apache.org/repos/asf/arrow-adbc.git
commit 893c54db3380dab264ad8ebba6b46433fb2e0db3 Author: David Li <[email protected]> AuthorDate: Tue Jun 6 14:28:48 2023 -0400 feat(format): remove unnecessary padding (#731) - Clarify one of the docstrings - Remove the 'future growth' padding since we have a different compatibility strategy --- adbc.h | 5 +---- c/driver_manager/adbc_driver_manager.cc | 3 --- c/driver_manager/adbc_driver_manager_test.cc | 2 -- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/adbc.h b/adbc.h index 756288da..5118f830 100644 --- a/adbc.h +++ b/adbc.h @@ -799,7 +799,7 @@ struct ADBC_EXPORT AdbcDriver { /// and attempt to have the driver initialize it with /// ADBC_VERSION_1_1_0. This must return an error, after which the /// driver will try again with ADBC_VERSION_1_0_0. The driver must - /// not access the new fields. + /// not access the new fields, which will carry undefined values. /// /// For a 1.1.0 driver being loaded by a 1.0.0 driver manager: the /// 1.0.0 manager will allocate the old AdbcDriver struct and @@ -845,9 +845,6 @@ struct ADBC_EXPORT AdbcDriver { AdbcStatusCode (*StatementSetOptionDouble)(struct AdbcStatement*, const char*, double, struct AdbcError*); - /// Pad the struct to have 96 pointers. Space reserved for future growth. - void* reserved[50]; - /// @} }; diff --git a/c/driver_manager/adbc_driver_manager.cc b/c/driver_manager/adbc_driver_manager.cc index a731cfbf..29e1cc1a 100644 --- a/c/driver_manager/adbc_driver_manager.cc +++ b/c/driver_manager/adbc_driver_manager.cc @@ -866,9 +866,6 @@ AdbcStatusCode AdbcLoadDriverFromInitFunc(AdbcDriverInitFunc init_func, int vers if (version >= ADBC_VERSION_1_1_0) { auto* driver = reinterpret_cast<struct AdbcDriver*>(raw_driver); FILL_DEFAULT(driver, StatementExecuteSchema); - - // Zero out the padding - std::memset(driver->reserved, 0, sizeof(driver->reserved)); } return ADBC_STATUS_OK; diff --git a/c/driver_manager/adbc_driver_manager_test.cc b/c/driver_manager/adbc_driver_manager_test.cc index 909af672..b7bbadea 100644 --- a/c/driver_manager/adbc_driver_manager_test.cc +++ b/c/driver_manager/adbc_driver_manager_test.cc @@ -34,8 +34,6 @@ namespace adbc { using adbc_validation::IsOkStatus; using adbc_validation::IsStatus; -TEST(Adbc, AdbcDriverSize) { ASSERT_EQ(sizeof(AdbcDriver), 96 * sizeof(void*)); } - class DriverManager : public ::testing::Test { public: void SetUp() override {
