region_compile中compile_rule缓存数组的大小,调整为与调用参数相同。去除部分无效代码。
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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<bool_match_ret; i++)
|
||||
{
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
#define MAX_DISTRICT_LEN 64
|
||||
|
||||
#define MAX_SCANNER_HIT_NUM 4096
|
||||
#define MAX_GROUP_CACHE 128
|
||||
|
||||
#define MAX_FAILED_NUM 128
|
||||
|
||||
|
||||
Reference in New Issue
Block a user