From a925ed039da2deeac919fb6bf758893d4d344a3a Mon Sep 17 00:00:00 2001 From: zhengchao Date: Sat, 5 Dec 2020 16:54:04 +0600 Subject: [PATCH] =?UTF-8?q?region=5Fcompile=E4=B8=ADcompile=5Frule?= =?UTF-8?q?=E7=BC=93=E5=AD=98=E6=95=B0=E7=BB=84=E7=9A=84=E5=A4=A7=E5=B0=8F?= =?UTF-8?q?=EF=BC=8C=E8=B0=83=E6=95=B4=E4=B8=BA=E4=B8=8E=E8=B0=83=E7=94=A8?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E7=9B=B8=E5=90=8C=E3=80=82=E5=8E=BB=E9=99=A4?= =?UTF-8?q?=E9=83=A8=E5=88=86=E6=97=A0=E6=95=88=E4=BB=A3=E7=A0=81=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/entry/Maat_api.cpp | 4 ++-- src/entry/Maat_hierarchy.cpp | 22 ---------------------- src/inc_internal/Maat_limits.h | 1 - test/test_maatframe.cpp | 17 +++++++++++++++-- 4 files changed, 17 insertions(+), 27 deletions(-) diff --git a/src/entry/Maat_api.cpp b/src/entry/Maat_api.cpp index 29cfa97..1880041 100644 --- a/src/entry/Maat_api.cpp +++ b/src/entry/Maat_api.cpp @@ -226,7 +226,7 @@ int region_compile(_Maat_feather_t*feather, struct Maat_hierarchy_compile_mid* c int scan_ret=0; int i=0; - struct Maat_compile_rule* compile_rule_array[MAX_SCANNER_HIT_NUM]; + struct Maat_compile_rule* compile_rule_array[size]; struct Maat_compile_rule* compile_rule=NULL; int virtual_table_id=0; @@ -247,7 +247,7 @@ int region_compile(_Maat_feather_t*feather, struct Maat_hierarchy_compile_mid* c Maat_hierarchy_compile_mid_udpate(compile_mid, region->region_id, virtual_table_id, region_hit_wraper->Nth_scan, i); } - scan_ret=Maat_hierarchy_region_compile(compile_mid, is_last_region, (void**)compile_rule_array, MAX_SCANNER_HIT_NUM); + scan_ret=Maat_hierarchy_region_compile(compile_mid, is_last_region, (void**)compile_rule_array, size); //Maat_hierarchy is rwlock protected, it always returns non-NULL compile_rule. if(scan_ret>1) { diff --git a/src/entry/Maat_hierarchy.cpp b/src/entry/Maat_hierarchy.cpp index d61acb2..7d36579 100644 --- a/src/entry/Maat_hierarchy.cpp +++ b/src/entry/Maat_hierarchy.cpp @@ -16,11 +16,6 @@ #define module_maat_hierarchy "MAAT_HIERARCHY" -#define TO_CLAUSE_ID(clause_index, compile_id) ((unsigned long long)clause_index<<32|compile_id) -#define TO_CLAUSE_ID_COMPATBILE(vid, gid) ((unsigned long long)vid<<32|gid) -#define TO_LITERAL_ID(vt_id, group_id) ((long long)vt_id<<32|group_id) - - struct Maat_hierarchy_group { @@ -53,17 +48,6 @@ struct Maat_hierarchy_literal_id int group_id; int virtual_table_id; }; -struct Maat_hierarchy_literal_usage_key -{ - int clause_index; - int compile_id; -}; -struct Maat_hierarchy_literal_usage -{ - struct Maat_hierarchy_literal_usage_key literal_usage_key; - char not_flag; - UT_hash_handle hh; -}; struct Maat_hierarchy_literal { @@ -100,10 +84,6 @@ static void _group_vertex_free(struct Maat_hierarchy_group* group) } - - - - struct Maat_hierarchy { pthread_rwlock_t rwlock; @@ -303,7 +283,6 @@ static void Maat_hierarchy_region_free(struct Maat_hierarchy* hier, struct Maat_ } - struct Maat_hierarchy* Maat_hierarchy_new(int thread_num, void* mesa_handle_logger) { struct Maat_hierarchy* hier=ALLOC(struct Maat_hierarchy, 1); @@ -1364,7 +1343,6 @@ int Maat_hierarchy_region_compile(struct Maat_hierarchy_compile_mid* mid, int is pthread_rwlock_rdlock(&hier->rwlock); bool_match_ret=bool_matcher_match(hier->bm, mid->thread_num, (unsigned long long*)utarray_eltptr(mid->_all_hit_clause_array, 0), utarray_len(mid->_all_hit_clause_array), - //mid->all_hit_clause_array, mid->all_hit_clause_cnt, (void**)compile_array, ud_array_sz); for(i=0; i