use pad instead of pack(4)

This commit is contained in:
liuwentan
2023-04-10 14:13:41 +08:00
parent f571b481f6
commit 53cd03995d
2 changed files with 7 additions and 6 deletions

View File

@@ -88,19 +88,19 @@ struct group2compile_runtime {
struct compile_runtime *ref_compile_rt; struct compile_runtime *ref_compile_rt;
struct group2group_runtime *ref_g2g_rt; struct group2group_runtime *ref_g2g_rt;
}; };
#pragma pack(4)
struct maat_clause_state { struct maat_clause_state {
long long clause_id; long long clause_id;
char not_flag;
char in_use;
UT_array *ut_literal_ids; UT_array *ut_literal_ids;
char not_flag; // 1 byte
char in_use; // 1 byte
char pad[6]; // for 8 bytes alignment
}; };
struct maat_literal_id { struct maat_literal_id {
long long group_id; long long group_id;
int vtable_id; long long vtable_id;
}; };
#pragma pack()
struct maat_clause { struct maat_clause {
long long clause_id; long long clause_id;

View File

@@ -292,7 +292,7 @@ int ip_table_set_line(struct maat *maat_instance, const char *table_name, enum m
return maat_cmd_set_line(maat_instance, &line_rule); return maat_cmd_set_line(maat_instance, &line_rule);
} }
#if 0 #if 1
class MaatFlagScan : public testing::Test class MaatFlagScan : public testing::Test
{ {
protected: protected:
@@ -5434,6 +5434,7 @@ TEST_F(MaatRollbackTest, FullConfigRollback) {
ret = rollback_redis_version(c, logger); ret = rollback_redis_version(c, logger);
EXPECT_EQ(ret, 0); EXPECT_EQ(ret, 0);
redisFree(c);
sleep(WAIT_FOR_EFFECTIVE_S * 2); sleep(WAIT_FOR_EFFECTIVE_S * 2);