Marker is a better name for this probably

This commit is contained in:
Gwilym Kuiper 2022-01-23 18:58:45 +00:00
parent 7c3725497c
commit 1562e63bee

View file

@ -64,7 +64,7 @@ pub struct VRamManager<'a> {
vram_free_pointer: Option<usize>, vram_free_pointer: Option<usize>,
} }
const END_OF_FREE_LIST_REFERENCE: u16 = u16::MAX; const END_OF_FREE_LIST_MARKER: u16 = u16::MAX;
impl<'a> VRamManager<'a> { impl<'a> VRamManager<'a> {
pub fn new() -> Self { pub fn new() -> Self {
@ -135,7 +135,7 @@ impl<'a> VRamManager<'a> {
} }
let index_to_copy_into = if let Some(ptr) = self.vram_free_pointer.take() { let index_to_copy_into = if let Some(ptr) = self.vram_free_pointer.take() {
if self.references[ptr] != END_OF_FREE_LIST_REFERENCE { if self.references[ptr] != END_OF_FREE_LIST_MARKER {
self.vram_free_pointer = Some(self.references[ptr] as usize); self.vram_free_pointer = Some(self.references[ptr] as usize);
} }
@ -180,7 +180,7 @@ impl<'a> VRamManager<'a> {
if let Some(ptr) = self.vram_free_pointer { if let Some(ptr) = self.vram_free_pointer {
self.references[index] = ptr as u16; self.references[index] = ptr as u16;
} else { } else {
self.references[index] = END_OF_FREE_LIST_REFERENCE; self.references[index] = END_OF_FREE_LIST_MARKER;
} }
self.vram_free_pointer = Some(index); self.vram_free_pointer = Some(index);