Skip to content

Commit de3edc5

Browse files
authored
Merge pull request #123 from Mark-Simulacrum/perf-rlo-changes
In-memory construction of profiling data
2 parents 048883e + c57ef2e commit de3edc5

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

analyzeme/src/profiling_data.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,17 @@ impl ProfilingData {
5252
fs::read(paths.string_index_file).expect("couldn't read string_index file");
5353
let event_data = fs::read(paths.events_file).expect("couldn't read events file");
5454

55+
ProfilingData::from_buffers(string_data, index_data, event_data)
56+
}
57+
58+
pub fn from_buffers(
59+
string_data: Vec<u8>,
60+
string_index: Vec<u8>,
61+
events: Vec<u8>,
62+
) -> Result<ProfilingData, Box<dyn Error>> {
63+
let index_data = string_index;
64+
let event_data = events;
65+
5566
let event_data_format = read_file_header(&event_data, FILE_MAGIC_EVENT_STREAM)?;
5667
if event_data_format != CURRENT_FILE_FORMAT_VERSION {
5768
Err(format!(

0 commit comments

Comments
 (0)