more review

This commit is contained in:
2025-07-04 14:40:25 -04:00
parent b15503c079
commit 87d5cda2c0
6 changed files with 29 additions and 20 deletions

View File

@ -5,20 +5,20 @@ An intersive singly & double linked list implementation
*/
package grime
LL_Node :: struct ( $ Type : typeid ) {
next : ^Type,
SLL_Node :: struct ($Type: typeid) {
next: ^Type,
}
// ll_push :: proc( list_ptr : ^(^ ($ Type)), node : ^Type ) {
ll_push :: #force_inline proc "contextless" ( list_ptr : ^(^ ($ Type)), node : ^Type ) {
list : ^Type = (list_ptr^)
node.next = list
(list_ptr^) = node
sll_push :: #force_inline proc "contextless" ( list_ptr : ^(^ ($ Type)), node : ^Type, node_next: ^(^Type) ) {
list: = (list_ptr ^)
(node_next ^) = list
(list_ptr ^) = node
}
ll_pop :: #force_inline proc "contextless" ( list_ptr : ^(^ ($ Type)) ) -> ( node : ^Type ) {
list : ^Type = (list_ptr^)
(list_ptr^) = list.next
sll_pop :: #force_inline proc "contextless" ( list_ptr: ^(^ ($ Type)), list_next: ^(^Type) ) -> ( node : ^Type ) {
list : ^Type = (list_ptr ^)
(list_ptr ^) = (list_next ^)
return list
}

View File

@ -353,7 +353,7 @@ pool_validate_ownership :: proc( using self : Pool, block : [] byte ) -> b32
{
misalignment := (block_address - start) % uintptr(block_size)
if misalignment != 0 {
// TODO(Ed): We cannot use thsi to validate that the data is within the pool bucket as we can provide the user different alignments
// TODO(Ed): We cannot use this to validate that the data is within the pool bucket as we can provide the user different alignments
// ensure(false, "pool_validate_ownership: This data is within this pool's buckets, however its not aligned to the start of a block")
// log(str_fmt("Block address: %p Misalignment: %p closest: %p",
// transmute(rawptr)block_address,