VEFontCache : Finished porting the LRU

This commit is contained in:
2024-06-03 01:04:24 -04:00
parent f99157aae5
commit 26ad2d1e49
8 changed files with 201 additions and 20 deletions

View File

@ -232,9 +232,9 @@ array_grow :: proc( using self : ^Array( $ Type ), min_capacity : u64 ) -> Alloc
return array_set_capacity( self, new_capacity )
}
array_pop :: proc( using self : Array( $ Type ) ) {
verify( num != 0, "Attempted to pop an array with no elements" )
num -= 1
array_pop :: proc( self : Array( $ Type ) ) {
verify( self.num != 0, "Attempted to pop an array with no elements" )
self.num -= 1
}
array_remove_at :: proc( using self : Array( $ Type ), id : u64 )

View File

@ -139,7 +139,7 @@ hmap_chained_reload :: proc( self : HMapChained($Type), allocator : Allocator )
// Entries already found to be vacant will not return true
hmap_chained_remove :: proc( self : HMapChained($Type), key : u64 ) -> b32
{
surface_slot := lookup[hmap_chained_lookup_id(self, key)]
surface_slot := self.lookup[hmap_chained_lookup_id(self, key)]
if surface_slot == nil {
return false
@ -150,7 +150,7 @@ hmap_chained_remove :: proc( self : HMapChained($Type), key : u64 ) -> b32
return true
}
for slot := surface_slot.next; slot != nil; slot.next
for slot := surface_slot.next; slot != nil; slot = slot.next
{
if slot.occupied && slot.key == key {
slot.occupied = false

View File

@ -32,7 +32,7 @@ import c "core:c/libc"
import "core:dynlib"
import "core:hash"
crc32 :: hash.crc32
crc32 :: hash.crc32
import "core:hash/xxhash"
xxh32 :: xxhash.XXH32