内存优化,优化随着更新ccr文件增多,内存增长的情况

This commit is contained in:
xiuting.xu
2026-05-13 14:08:07 +08:00
parent ff711a2fe1
commit 9dc69e5f31
10 changed files with 152 additions and 65 deletions

View File

@@ -150,6 +150,24 @@ pub fn validate_payload_updates_for_rtr(
Ok(())
}
pub fn validate_payload_update_refs_for_rtr(
updates: &[(bool, &Payload)],
) -> Result<(), OrderingViolation> {
for (index, pair) in updates.windows(2).enumerate() {
if compare_payload_update_for_rtr(pair[0].1, pair[0].0, pair[1].1, pair[1].0)
== Ordering::Greater
{
return Err(OrderingViolation::new_update(
index,
(pair[0].0, pair[0].1),
(pair[1].0, pair[1].1),
));
}
}
Ok(())
}
fn router_key_key(rk: &RouterKey) -> RouterKeyKey {
RouterKeyKey::Key {
ski: rk.ski(),