reduce unnecessary memory usage & add maat_stat info
This commit is contained in:
@@ -429,11 +429,9 @@ int interval_runtime_update(void *interval_runtime, void *interval_schema,
|
||||
return -1;
|
||||
}
|
||||
|
||||
struct maat_item_inner *inner_item = maat_item_inner_new(interval_item->item_id,
|
||||
interval_item->group_id,
|
||||
interval_item->district_id);
|
||||
interval_item->user_data = inner_item;
|
||||
interval_item->user_data_free = maat_item_inner_free;
|
||||
struct item_district *item_dist = item_district_new(interval_item->district_id);
|
||||
interval_item->user_data = item_dist;
|
||||
interval_item->user_data_free = item_district_free;
|
||||
}
|
||||
|
||||
int ret = interval_runtime_update_row(interval_rt, (char *)&item_id, sizeof(long long),
|
||||
@@ -562,15 +560,15 @@ int interval_runtime_scan(struct interval_runtime *interval_rt, int thread_id,
|
||||
}
|
||||
|
||||
struct maat_item hit_maat_items[MAX_SCANNER_HIT_ITEM_NUM];
|
||||
struct maat_item_inner *inner_item = NULL;
|
||||
struct item_district *item_dist = NULL;
|
||||
struct interval_item *int_item = NULL;
|
||||
size_t real_hit_item_cnt = 0;
|
||||
long long district_id = state->district_id;
|
||||
|
||||
for (int i = 0; i < n_hit_item; i++) {
|
||||
inner_item = (struct maat_item_inner *)(hit_results[i].user_tag);
|
||||
if (inner_item->district_id == district_id ||
|
||||
inner_item->district_id == DISTRICT_ANY) {
|
||||
item_dist = (struct item_district *)(hit_results[i].user_tag);
|
||||
long long tag_district_id = item_district_id(item_dist);
|
||||
if (tag_district_id == district_id || tag_district_id == DISTRICT_ANY) {
|
||||
long long item_id = hit_results[i].rule_id;
|
||||
int_item = (struct interval_item *)rcu_hash_find(interval_rt->item_hash,
|
||||
(char *)&item_id,
|
||||
|
||||
Reference in New Issue
Block a user