Skip to content

Commit

Permalink
Use TiVec.
Browse files Browse the repository at this point in the history
  • Loading branch information
ptersilie committed Feb 2, 2024
1 parent c768336 commit a94190f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ykrt/src/compile/jitc_yk/tracevec.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
use super::aot_ir::InstrIdx;
use typed_index_collections::TiVec;

use super::jit_ir::Instruction;

/// A wrapper around a vector of instructions used to store a trace. Since we disallow removal and
/// insertion (with the exception of appending at the end) into the vector, the wrapper only
/// exposes the pushing and replacing of instructions.
#[derive(Debug)]
pub struct TraceVec(Vec<Instruction>);
pub struct TraceVec(TiVec<InstrIdx, Instruction>);

impl TraceVec {
pub fn new() -> Self {
TraceVec(Vec::new())
TraceVec(Vec::new().into())
}

pub fn push(&mut self, instr: Instruction) {
Expand Down

0 comments on commit a94190f

Please sign in to comment.