misc changes
This commit is contained in:
5
code/grime/hashing.odin
Normal file
5
code/grime/hashing.odin
Normal file
@ -0,0 +1,5 @@
|
||||
package grime
|
||||
|
||||
djb8_hash :: #force_inline proc "contextless" ( hash : ^u64, bytes : []byte ) {
|
||||
for value in bytes do (hash^) = (( (hash^) << 8) + (hash^) ) + u64(value)
|
||||
}
|
@ -94,4 +94,8 @@ memory_aign_forward :: #force_inline proc( address, alignment : uintptr) -> uint
|
||||
|
||||
//endregion Memory Math
|
||||
|
||||
swap :: #force_inline proc( a, b : ^ $Type ) -> ( ^ Type, ^ Type ) { return b, a }
|
||||
swap :: #force_inline proc "contextless" ( a, b : ^ $Type ) -> ( ^ Type, ^ Type ) { return b, a }
|
||||
|
||||
to_bytes :: #force_inline proc "contextless" ( typed_block : ^$Type ) -> []byte {
|
||||
return slice_ptr( transmute(^byte) typed_block, size_of(Type) )
|
||||
}
|
||||
|
Reference in New Issue
Block a user