-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The new gimli version stores offsets instead of readers in the evaluation cache, which means that our readers no longer have to take Arcs to the module data.
- Loading branch information
Showing
12 changed files
with
151 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,32 @@ | ||
use core::ops::Deref; | ||
|
||
use super::unwind_rule::*; | ||
use crate::cache::*; | ||
|
||
/// The unwinder cache type for [`UnwinderAarch64`](super::UnwinderAarch64). | ||
pub struct CacheAarch64<D: Deref<Target = [u8]>, P: AllocationPolicy<D> = MayAllocateDuringUnwind>( | ||
pub Cache<D, UnwindRuleAarch64, P>, | ||
pub struct CacheAarch64<P: AllocationPolicy = MayAllocateDuringUnwind>( | ||
pub Cache<UnwindRuleAarch64, P>, | ||
); | ||
|
||
impl<D: Deref<Target = [u8]>, P: AllocationPolicy<D>> CacheAarch64<D, P> { | ||
impl CacheAarch64<MayAllocateDuringUnwind> { | ||
/// Create a new cache. | ||
pub fn new() -> Self { | ||
Self(Cache::new()) | ||
} | ||
} | ||
|
||
impl<P: AllocationPolicy> CacheAarch64<P> { | ||
/// Create a new cache. | ||
pub fn new_in() -> Self { | ||
Self(Cache::new()) | ||
} | ||
|
||
/// Returns a snapshot of the cache usage statistics. | ||
pub fn stats(&self) -> CacheStats { | ||
self.0.rule_cache.stats() | ||
} | ||
} | ||
|
||
impl<D: Deref<Target = [u8]>, P: AllocationPolicy<D>> Default for CacheAarch64<D, P> { | ||
impl<P: AllocationPolicy> Default for CacheAarch64<P> { | ||
fn default() -> Self { | ||
Self::new() | ||
Self::new_in() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.