misc changes

This commit is contained in:
ed committed 2025-01-03 13:06:05 -05:00
1 parent db1701a5d7
commit 8c7b3e2058
5 files changed
+59 -4

No files matched your search

+5
View 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)
}
+5 -1
View File
@@ -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) )
}