Skip to content

Commit

Permalink
feat(format): remove unnecessary padding (#731)
Browse files Browse the repository at this point in the history
- Clarify one of the docstrings
- Remove the 'future growth' padding since we have a different
compatibility strategy
  • Loading branch information
lidavidm committed Jul 11, 2023
1 parent 734682b commit 4c86ba2
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 9 deletions.
5 changes: 1 addition & 4 deletions adbc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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];

/// @}
};

Expand Down
3 changes: 0 additions & 3 deletions c/driver_manager/adbc_driver_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions c/driver_manager/adbc_driver_manager_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 4c86ba2

Please sign in to comment.