summaryrefslogtreecommitdiff
path: root/shaping/test/stub.cpp
diff options
context:
space:
mode:
authorroot <[email protected]>2023-12-19 06:32:10 +0000
committerroot <[email protected]>2023-12-19 06:32:10 +0000
commit26ce1b6977f5ccce38bbfc8272edf81794a634f0 (patch)
tree4a40210971428267e9c438c9c247445ba946c9f6 /shaping/test/stub.cpp
parentbf2c165e0ce29f1fa52780e62f185eb151e1d20e (diff)
OMPUB-1083: 由本地计数修改为使用maat的自动垃圾回收机制
Diffstat (limited to 'shaping/test/stub.cpp')
-rw-r--r--shaping/test/stub.cpp7
1 files changed, 0 insertions, 7 deletions
diff --git a/shaping/test/stub.cpp b/shaping/test/stub.cpp
index f3c89e5..45a2e55 100644
--- a/shaping/test/stub.cpp
+++ b/shaping/test/stub.cpp
@@ -187,17 +187,12 @@ void stub_init()
memset(&matched_rules, 0, sizeof(struct stub_matched_rules));
memset(&pf_array, 0, MAX_STUB_PROFILE_NUM * sizeof(struct shaping_profile));
- for (i = 0; i < MAX_STUB_RULE_NUM; i++) {
- matched_rules.rules[i].ref_cnt = 1;
- }
-
for (i = 0; i < MAX_STUB_PROFILE_NUM; i++) {
pf_curr_avl_token[i].in_limit_bandwidth = DEFAULT_AVALIABLE_TOKEN_PER_SEC;
pf_curr_avl_token[i].out_limit_bandwidth = DEFAULT_AVALIABLE_TOKEN_PER_SEC;
pf_array[i].id = i;
pf_array[i].in_limit_bandwidth = DEFAULT_AVALIABLE_TOKEN_PER_SEC;
pf_array[i].out_limit_bandwidth = DEFAULT_AVALIABLE_TOKEN_PER_SEC;
- pf_array[i].ref_cnt = 1;
pf_async_times[i] = 0;
}
return;
@@ -531,11 +526,9 @@ void *maat_plugin_table_get_ex_data(struct maat *instance, int table_id, const c
if (table_id == STUB_MAAT_SHAPING_RULE_TABLE_ID) {
rule_id = *(int*)key;
- matched_rules.rules[rule_id].ref_cnt++;
return &matched_rules.rules[rule_id];
} else {
profile_id = atoi(key);
- pf_array[profile_id].ref_cnt++;
return &pf_array[profile_id];
}
}