Misc changes (refactors, notes)
This commit is contained in:
@ -310,14 +310,3 @@ array_block_size :: proc "contextless" ( self : Array( $Type ) ) -> u64 {
|
||||
block_size := cast(u64) (header_size + self.capacity * size_of(Type))
|
||||
return block_size
|
||||
}
|
||||
|
||||
array_memtracker_entry :: proc( self : Array( $Type ), name : string ) -> MemoryTrackerEntry {
|
||||
header_size :: size_of(ArrayHeader(Type))
|
||||
block_size := cast(uintptr) (header_size + (cast(uintptr) self.capacity) * size_of(Type))
|
||||
|
||||
block_start := transmute(^u8) self.header
|
||||
block_end := ptr_offset( block_start, block_size )
|
||||
|
||||
tracker_entry := MemoryTrackerEntry { name, block_start, block_end }
|
||||
return tracker_entry
|
||||
}
|
||||
|
1
code/grime/growing_sub_arena.odin
Normal file
1
code/grime/growing_sub_arena.odin
Normal file
@ -0,0 +1 @@
|
||||
package grime
|
@ -21,27 +21,6 @@ push_back_slice_queue :: proc( self : ^$QueueType / Queue($Type), slice : []Type
|
||||
{
|
||||
queue.push_back_elems( self, ..slice )
|
||||
return
|
||||
|
||||
// num := cast(uint) len(slice)
|
||||
|
||||
// if uint( space_left( self^ )) < num {
|
||||
// error = queue._grow( self, self.len + num )
|
||||
// if error != .None do return
|
||||
// }
|
||||
|
||||
// size := uint(len(self.data))
|
||||
// insert_from := (self.offset + self.len) % size
|
||||
// insert_to := num
|
||||
|
||||
// if insert_from + insert_to > size {
|
||||
// insert_to = size - insert_from
|
||||
// }
|
||||
|
||||
// copy( self.data[ insert_from : ], slice[ : insert_to ])
|
||||
// copy( self.data[ : insert_from ], slice[ insert_to : ])
|
||||
|
||||
// self.len += num
|
||||
// return
|
||||
}
|
||||
|
||||
QueueIterator :: struct( $Type : typeid ) {
|
||||
|
@ -64,6 +64,8 @@ str_cache_init :: proc( table_allocator, slabs_allocator : Allocator ) -> (cache
|
||||
|
||||
@static dbg_name := "StringCache slab"
|
||||
|
||||
// TODO(Ed): Is this nessary (essentially is there a perf impact of using vs not using, which is better because thats all that matters)
|
||||
// Interning should only be handled on a growing arena anyway so it doesn't really need this.
|
||||
alloc_error : AllocatorError
|
||||
cache.slab, alloc_error = slab_init( & policy, allocator = slabs_allocator, dbg_name = dbg_name )
|
||||
verify(alloc_error == .None, "Failed to initialize the string cache" )
|
||||
|
Reference in New Issue
Block a user