more review
This commit is contained in:
@ -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
|
||||
}
|
||||
|
||||
|
@ -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,
|
||||
|
Reference in New Issue
Block a user