updating base with stuff missing from metagens's base (was in the regular base of raddbg)

This commit is contained in:
ed
2025-02-06 18:00:46 -05:00
parent 1a3f7e0e8a
commit 887851e36c
14 changed files with 721 additions and 410 deletions
+39
View File
@@ -143,6 +143,45 @@
#define memory_consume(T, p, e) ( ((p) + sizeof(T) <= (e)) ? ((p) += sizeof(T), *(T*)((p) - sizeof(T))) : ((p) = (e),0) )
#endif
////////////////////////////////
//~ rjf: Memory Functions
inline B32
memory_is_zero(void *ptr, U64 size){
B32 result = 1;
// break down size
U64 extra = (size&0x7);
U64 count8 = (size >> 3);
// check with 8-byte stride
U64 *p64 = (U64*)ptr;
if(result)
{
for (U64 i = 0; i < count8; i += 1, p64 += 1){
if (*p64 != 0){
result = 0;
goto done;
}
}
}
// check extra
if(result)
{
U8 *p8 = (U8*)p64;
for (U64 i = 0; i < extra; i += 1, p8 += 1){
if (*p8 != 0){
result = 0;
goto done;
}
}
}
done:;
return(result);
}
inline
void* mem_move( void* destination, void const* source, SSIZE byte_count )
{