Skip to content

Commit b882c00

Browse files
committed
Expose more functionality.
1 parent 9fde4ab commit b882c00

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

memapi/src/memorytracking.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ impl LineNumberInfo {
104104
#[derive(Clone, Debug, PartialEq, Eq, Copy, Hash, Serialize, Deserialize)]
105105
pub struct CallSiteId {
106106
/// The function + filename. We use IDs for performance reasons (faster hashing).
107-
function: FunctionId,
107+
pub function: FunctionId,
108108
/// Line number within the _file_, 1-indexed.
109-
line_number: LineNumberInfo,
109+
pub line_number: LineNumberInfo,
110110
}
111111

112112
impl CallSiteId {
@@ -142,6 +142,10 @@ impl Callstack {
142142
}
143143
}
144144

145+
pub fn to_vec(&self) -> Vec<CallSiteId> {
146+
self.calls.clone()
147+
}
148+
145149
pub fn start_call(&mut self, parent_line_number: u32, callsite_id: CallSiteId) {
146150
if parent_line_number != 0 {
147151
if let Some(mut call) = self.calls.last_mut() {

0 commit comments

Comments
 (0)