Skip to content

Commit

Permalink
Start rc at 0, not 1
Browse files Browse the repository at this point in the history
  • Loading branch information
jfecher committed Nov 21, 2024
1 parent b4f0187 commit 204de4a
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ use super::{
BrilligContext, ReservedRegisters, BRILLIG_MEMORY_ADDRESSING_BIT_SIZE,
};

const INITIAL_ARRAY_REF_COUNT: usize = 0;

impl<F: AcirField + DebugToString, Registers: RegisterAllocator> BrilligContext<F, Registers> {
/// Allocates an array of size `size` and stores the pointer to the array
/// in `pointer_register`
Expand Down Expand Up @@ -424,7 +426,7 @@ impl<F: AcirField + DebugToString, Registers: RegisterAllocator> BrilligContext<
self.indirect_const_instruction(
array.pointer,
BRILLIG_MEMORY_ADDRESSING_BIT_SIZE,
1_usize.into(),
INITIAL_ARRAY_REF_COUNT.into(),
);
}

Expand All @@ -438,7 +440,7 @@ impl<F: AcirField + DebugToString, Registers: RegisterAllocator> BrilligContext<
self.indirect_const_instruction(
vector.pointer,
BRILLIG_MEMORY_ADDRESSING_BIT_SIZE,
1_usize.into(),
INITIAL_ARRAY_REF_COUNT.into(),
);

// Write size
Expand Down Expand Up @@ -498,7 +500,7 @@ impl<F: AcirField + DebugToString, Registers: RegisterAllocator> BrilligContext<
self.indirect_const_instruction(
vector.pointer,
BRILLIG_MEMORY_ADDRESSING_BIT_SIZE,
1_usize.into(),
INITIAL_ARRAY_REF_COUNT.into(),
);

// Initialize size
Expand Down

0 comments on commit 204de4a

Please sign in to comment.