simplified Autoarr/Hashtable _foreach

This commit is contained in:
Timerix22 2023-05-20 01:40:16 +06:00
parent d7136055d9
commit 461aef3a00
19 changed files with 78 additions and 71 deletions

View File

@ -23,20 +23,20 @@ Autoarr_declare(u64)
Autoarr_declare(Unitype) Autoarr_declare(Unitype)
#define Autoarr_foreach(ar,elem,codeblock)({ \ #define Autoarr_foreach(ar, elem, codeblock...) { \
if(ar->blocks_count>0) { \ if(ar->blocks_count>0) { \
typeof(**ar->values) elem; \ typeof(**ar->values) elem; \
for(u16 blockI=0;blockI<ar->blocks_count-1;blockI++) \ for(u16 blockI=0;blockI<ar->blocks_count-1;blockI++) \
for(u32 elemI=0;elemI<ar->max_block_length;elemI++){ \ for(u32 elemI=0;elemI<ar->max_block_length;elemI++){ \
elem=ar->values[blockI][elemI]; \ elem=ar->values[blockI][elemI]; \
(codeblock); \ { codeblock; } \
} \ } \
for(u16 elemI=0;elemI<ar->block_length;elemI++){ \ for(u16 elemI=0;elemI<ar->block_length;elemI++){ \
elem=ar->values[ar->blocks_count-1][elemI]; \ elem=ar->values[ar->blocks_count-1][elemI]; \
(codeblock); \ { codeblock; } \
} \ } \
} \ } \
}) }
#if __cplusplus #if __cplusplus
} }

View File

@ -50,11 +50,11 @@ void __Autoarr_##type##_freeWithoutMembers(Autoarr_##type* ar, bool freePtr){ \
\ \
void __Autoarr_##type##_freeWithMembers(Autoarr_##type* ar, bool freePtr){ \ void __Autoarr_##type##_freeWithMembers(Autoarr_##type* ar, bool freePtr){ \
if(ktDescriptor_##type.freeMembers!=NULL) { \ if(ktDescriptor_##type.freeMembers!=NULL) { \
Autoarr_foreach(ar, el, ({ \ Autoarr_foreach(ar, el, \
void* members_ptr=&el; \ void* members_ptr=&el; \
if(TYPE_IS_PTR) members_ptr=*(type**)members_ptr; \ if(TYPE_IS_PTR) members_ptr=*(type**)members_ptr; \
ktDescriptor_##type.freeMembers(members_ptr); \ ktDescriptor_##type.freeMembers(members_ptr); \
})); \ ); \
} \ } \
__Autoarr_##type##_freeWithoutMembers(ar, freePtr);\ __Autoarr_##type##_freeWithoutMembers(ar, freePtr);\
} \ } \

View File

@ -55,12 +55,12 @@ Maybe __AppendValue(SerializeSharedData* shared, Unitype u){
AppendTabs(); AppendTabs();
addc('['); addc('[');
tabs++; tabs++;
Autoarr_foreach(((Autoarr_Unitype*)(u.VoidPtr)), e, ({ Autoarr_foreach(((Autoarr_Unitype*)(u.VoidPtr)), e,
addc('\n'); addc('\n');
AppendTabs(); AppendTabs();
try(AppendValue(e),__,;); try(AppendValue(e),__,;);
addc(','); addc(',');
})); );
StringBuilder_rmchar(b); StringBuilder_rmchar(b);
addc('\n'); addc('\n');
tabs--; tabs--;
@ -75,11 +75,11 @@ Maybe __AppendValue(SerializeSharedData* shared, Unitype u){
else if(u.typeId==ktid_ptrName(Hashtable)){ else if(u.typeId==ktid_ptrName(Hashtable)){
// check hashtable is blank // check hashtable is blank
bool hashtableNotBlank=false; bool hashtableNotBlank=false;
Hashtable_foreach(((Hashtable*)u.VoidPtr), __, ({ Hashtable_foreach(((Hashtable*)u.VoidPtr), __,
hashtableNotBlank=true; hashtableNotBlank=true;
if(__.key) {} // weird way to disable warning if(__.key) {} // weird way to disable warning
break; break;
})); );
if(hashtableNotBlank){ if(hashtableNotBlank){
addc('\n'); addc('\n');
@ -109,7 +109,7 @@ Maybe __serialize(StringBuilder* _b, u8 _tabs, Hashtable* dtsod){
}; };
SerializeSharedData* shared=&_shared; SerializeSharedData* shared=&_shared;
Hashtable_foreach(dtsod, p, ({ Hashtable_foreach(dtsod, p,
AppendTabs(); AppendTabs();
StringBuilder_append_cptr(b,p.key); StringBuilder_append_cptr(b,p.key);
addc(':'); addc(':');
@ -117,7 +117,7 @@ Maybe __serialize(StringBuilder* _b, u8 _tabs, Hashtable* dtsod){
try(AppendValue(p.value),__,;); try(AppendValue(p.value),__,;);
addc(';'); addc(';');
addc('\n'); addc('\n');
})); );
return MaybeNull; return MaybeNull;
} }

View File

@ -33,13 +33,13 @@ Unitype* Hashtable_getPtr(Hashtable* ht, char* key);
Unitype Hashtable_get(Hashtable* ht, char* key); Unitype Hashtable_get(Hashtable* ht, char* key);
bool Hashtable_try_get(Hashtable* ht, char* key, Unitype* output); bool Hashtable_try_get(Hashtable* ht, char* key, Unitype* output);
#define Hashtable_foreach(HT, EL, codeblock)({ \ #define Hashtable_foreach(HT, EL, codeblock...) { \
u16 hmax=Hashtable_height(HT); \ u16 hmax=Hashtable_height(HT); \
for(u16 h=0; h<hmax; h++){ \ for(u16 h=0; h<hmax; h++){ \
Autoarr(KVPair)* AR=HT->rows[h]; \ Autoarr(KVPair)* AR=HT->rows[h]; \
Autoarr_foreach(AR, EL, codeblock); \ Autoarr_foreach(AR, EL, codeblock); \
} \ } \
}) }
#if __cplusplus #if __cplusplus
} }

View File

@ -16,7 +16,7 @@ extern "C" {
#define LLNode_create(TYPE, VALUE) LLNode_##TYPE##_create(VALUE) #define LLNode_create(TYPE, VALUE) LLNode_##TYPE##_create(VALUE)
#define LinkedList_create(TYPE) LinkedList_##TYPE##_create() #define LinkedList_create(TYPE) LinkedList_##TYPE##_create()
#define LinkedList_free(LLIST) ({ LLIST->_functions->freeMembers(LLIST); free(LLIST); }) #define LinkedList_free(LLIST) ({ LLIST->_functions->freeMembers(LLIST); free(LLIST); })
void LinkedList_addToBeginning(void* _llist, void* _new_node); void LinkedList_addToBeginning(void* _llist, void* _new_node);

View File

@ -13,9 +13,9 @@ void complete_buf(StringBuilder* b){
if(!len) return; if(!len) return;
string str={.length=len, .ptr=malloc(len)}; string str={.length=len, .ptr=malloc(len)};
u32 i=0; u32 i=0;
Autoarr_foreach(b->curr_buf, c, ({ Autoarr_foreach(b->curr_buf, c,
str.ptr[i++]=c; str.ptr[i++]=c;
})); );
Autoarr_add(b->compl_bufs,str); Autoarr_add(b->compl_bufs,str);
Autoarr_free(b->curr_buf, true); Autoarr_free(b->curr_buf, true);
b->curr_buf=Autoarr_create(i8,BL_C,BL_L); b->curr_buf=Autoarr_create(i8,BL_C,BL_L);
@ -47,17 +47,17 @@ void StringBuilder_free(StringBuilder* b){
string StringBuilder_build(StringBuilder* b){ string StringBuilder_build(StringBuilder* b){
complete_buf(b); complete_buf(b);
u32 len=0; u32 len=0;
Autoarr_foreach(b->compl_bufs, cs, ({ Autoarr_foreach(b->compl_bufs, cs,
len+=cs.length; len+=cs.length;
})); );
string str= { .length=len, .ptr=malloc(len+1) }; string str= { .length=len, .ptr=malloc(len+1) };
str.ptr[len]='\0'; str.ptr[len]='\0';
u32 i=0; u32 i=0;
Autoarr_foreach(b->compl_bufs, cs, ({ Autoarr_foreach(b->compl_bufs, cs,
for(u32 n=0;n<cs.length;n++) for(u32 n=0;n<cs.length;n++)
str.ptr[i++]=cs.ptr[n]; str.ptr[i++]=cs.ptr[n];
free(cs.ptr); free(cs.ptr);
})); );
StringBuilder_free(b); StringBuilder_free(b);
return str; return str;
} }

View File

@ -37,7 +37,7 @@ void printMaybe(Maybe e);
#define __RETURN_EXCEPTION(ERRMSG) return (Maybe){.value=UniNull, .errmsg=ERRMSG} #define __RETURN_EXCEPTION(ERRMSG) return (Maybe){.value=UniNull, .errmsg=ERRMSG}
#define __EXIT(ERRMSG) ({ kprintf("\e[91m%s\e[0m \n", ERRMSG); free(ERRMSG); exit(128); }) #define __EXIT(ERRMSG) ({ kprintf("\e[91m%s\e[0m \n", ERRMSG); free(ERRMSG); exit(128); })
char* __doNothing(char* a); char* __doNothing(char* a);
char* __unknownErr( ); char* __unknownErr( );

View File

@ -19,23 +19,23 @@
/// executes codeblock and prints execution time /// executes codeblock and prints execution time
/// u64 op_i is counter of the internal loop /// u64 op_i is counter of the internal loop
/// uses non-standard high-precision clock /// uses non-standard high-precision clock
#define optime(opname,repeats,codeblock) ({ \ #define optime(opname, repeats, codeblock...) { \
struct timespec start, stop; \ struct timespec start, stop; \
clock_gettime(CLOCK_REALTIME, &start); \ clock_gettime(CLOCK_REALTIME, &start); \
for(u64 op_i=0;op_i<(u64)repeats;op_i++) \ for(u64 op_i=0;op_i<(u64)repeats;op_i++) \
(codeblock); \ { codeblock; } \
clock_gettime(CLOCK_REALTIME, &stop); \ clock_gettime(CLOCK_REALTIME, &stop); \
f64 t=(f64)(stop.tv_sec-start.tv_sec)*1000000+(f64)(stop.tv_nsec-start.tv_nsec)/1000; \ f64 t=(f64)(stop.tv_sec-start.tv_sec)*1000000+(f64)(stop.tv_nsec-start.tv_nsec)/1000; \
__optime_print(opname,t) \ __optime_print(opname,t); \
}) }
#else #else
/// uses standard low precision clock /// uses standard low precision clock
#define optime(opname,repeats,codeblock) ({ \ #define optime(opname, repeats, codeblock...) { \
clock_t start=clock(); \ clock_t start=clock(); \
for(u64 op_i=0;op_i<(u64)repeats;op_i++) \ for(u64 op_i=0;op_i<(u64)repeats;op_i++) \
(codeblock); \ { codeblock; } \
clock_t stop=clock(); \ clock_t stop=clock(); \
f64 t=(f64)(stop-start)/CLOCKS_PER_SEC*1000000; \ f64 t=(f64)(stop-start)/CLOCKS_PER_SEC*1000000; \
__optime_print(opname,t) \ __optime_print(opname,t); \
}) }
#endif #endif

View File

@ -50,6 +50,7 @@ void kprintf(const char* format, ...){
va_start(vl, format); va_start(vl, format);
u32 i=0; u32 i=0;
for(char c=format[i++]; c!=0; c=format[i++]){ for(char c=format[i++]; c!=0; c=format[i++]){
// value format specifiers
if(c=='%'){ if(c=='%'){
char* argstr=NULL; char* argstr=NULL;
bool l=false; bool l=false;
@ -112,8 +113,11 @@ void kprintf(const char* format, ...){
fputs(argstr, stdout); fputs(argstr, stdout);
free(argstr); free(argstr);
} }
} else if(c=='\e'){ }
// escape sequences
else if(c=='\e'){
IFWIN( IFWIN(
/* WINDOWS */
({ ({
if((c=format[i++])=='['){ if((c=format[i++])=='['){
u8 colorUnix=0; u8 colorUnix=0;
@ -135,9 +139,12 @@ void kprintf(const char* format, ...){
} }
} }
}), }),
/* UNIX */
putc(c,stdout); putc(c,stdout);
); );
} else { }
// common characters
else {
putc(c,stdout); putc(c,stdout);
} }
#if defined(_WIN64) || defined(_WIN32) #if defined(_WIN64) || defined(_WIN32)

View File

@ -21,7 +21,7 @@ i64 _autoarrVsVector(u16 blockCount, u16 blockLength){
} }
void test_autoarrVsVector(){ void test_autoarrVsVector(){
optime(__func__, 1, ({ optime(__func__, 1,
kprintf("\e[96m-------[test_autoarr_vs_vector]-------\n"); kprintf("\e[96m-------[test_autoarr_vs_vector]-------\n");
_autoarrVsVector(4, 16); _autoarrVsVector(4, 16);
_autoarrVsVector(16, 64); _autoarrVsVector(16, 64);
@ -30,5 +30,5 @@ void test_autoarrVsVector(){
_autoarrVsVector(32, 1024); _autoarrVsVector(32, 1024);
_autoarrVsVector(256, 256); _autoarrVsVector(256, 256);
_autoarrVsVector(1024, 1024); _autoarrVsVector(1024, 1024);
})); );
} }

View File

@ -36,7 +36,7 @@ static void printallval(Autoarr(u16)* ar){
} }
void test_autoarr(){ void test_autoarr(){
optime("test_autoarr",1,({ optime("test_autoarr",1,
kprintf("\e[96m------------[test_autoarr]------------\n"); kprintf("\e[96m------------[test_autoarr]------------\n");
Autoarr(u16)* ar=Autoarr_create(u16,10,16); Autoarr(u16)* ar=Autoarr_create(u16,10,16);
kprintf("\e[92mautoarr created\n"); kprintf("\e[92mautoarr created\n");
@ -49,5 +49,5 @@ void test_autoarr(){
printallval(ar); printallval(ar);
Autoarr_free(ar, true); Autoarr_free(ar, true);
kprintf("\e[92mautoarr deleted\n"); kprintf("\e[92mautoarr deleted\n");
})); );
} }

View File

@ -16,50 +16,50 @@ const char text[]=
void print_dtsod(Hashtable* dtsod){ void print_dtsod(Hashtable* dtsod){
kprintf("\e[92m"); kprintf("\e[92m");
Hashtable_foreach(dtsod, p,({ Hashtable_foreach(dtsod, p,
printkvp(p); printkvp(p);
if(p.value.typeId==ktid_ptrName(Hashtable)){ if(p.value.typeId==ktid_ptrName(Hashtable)){
kprintf(": {\n"); kprintf(": {\n");
Hashtable* sub=p.value.VoidPtr; Hashtable* sub=p.value.VoidPtr;
Hashtable_foreach(sub, _p,({ Hashtable_foreach(sub, _p,
kprintf(" "); kprintf(" ");
printkvp(_p); printkvp(_p);
kprintf("\n"); kprintf("\n");
})); );
kprintf("}"); kprintf("}");
} }
kprintf("\n"); kprintf("\n");
})); );
} }
void test_dtsod(){ void test_dtsod(){
optime(__func__,1,({ optime(__func__,1,
kprintf("\e[96m-------------[test_dtsod]-------------\n"); kprintf("\e[96m-------------[test_dtsod]-------------\n");
Hashtable* dtsod; Hashtable* dtsod;
char* s; char* s;
optime("deserialize",1,({ optime("deserialize",1,
tryLast(DtsodV24_deserialize(text),r) tryLast(DtsodV24_deserialize(text),r)
dtsod=r.value.VoidPtr; dtsod=r.value.VoidPtr;
})); );
print_dtsod(dtsod); print_dtsod(dtsod);
optime("serialize",1,({ optime("serialize",1,
tryLast(DtsodV24_serialize(dtsod),r) tryLast(DtsodV24_serialize(dtsod),r)
s=r.value.VoidPtr; s=r.value.VoidPtr;
})); );
DtsodV24_free(dtsod); DtsodV24_free(dtsod);
kprintf("\e[92m%s",s); kprintf("\e[92m%s",s);
optime("reserialize",10,({ optime("reserialize",10,
tryLast(DtsodV24_deserialize(s),r) tryLast(DtsodV24_deserialize(s),r)
dtsod=r.value.VoidPtr; dtsod=r.value.VoidPtr;
free(s); free(s);
tryLast(DtsodV24_serialize(dtsod),rr) tryLast(DtsodV24_serialize(dtsod),rr)
s=rr.value.VoidPtr; s=rr.value.VoidPtr;
DtsodV24_free(dtsod); DtsodV24_free(dtsod);
})); );
free(s); free(s);
})); );
} }

View File

@ -8,39 +8,39 @@
char data[]="iojihiojopijiugbjmoihftytryfdrh"; char data[]="iojihiojopijiugbjmoihftytryfdrh";
#define test_hashfunc(hasht, hashf)({ \ #define test_hashfunc(hasht, hashf) { \
kprintf("\e[94mfunction: \e[92m" #hashf "\n"); \ kprintf("\e[94mfunction: \e[92m" #hashf "\n"); \
hasht h=0; \ hasht h=0; \
optime("speed test", 1, ({ \ optime("speed test", 1, \
for(u32 i=0; i<SPEED_TESTS; i++) \ for(u32 i=0; i<SPEED_TESTS; i++) \
h=hashf(h, data, sizeof(data)); \ h=hashf(h, data, sizeof(data)); \
})); \ ); \
/*kprintf("\e[94mhash of \"\e[90m%s\e[94m\": \e[92m%x\n",data, h);*/ \ /*kprintf("\e[94mhash of \"\e[90m%s\e[94m\": \e[92m%x\n",data, h);*/ \
Autoarr(hasht)* hashes=Autoarr_create(hasht,512,32768); \ Autoarr(hasht)* hashes=Autoarr_create(hasht,512,32768); \
optime("collision test",1,({ \ optime("collision test",1, \
u32 collisions=0; \ u32 collisions=0; \
for(u64 i=0;i< COLLISION_TESTS;i++){ \ for(u64 i=0;i< COLLISION_TESTS;i++){ \
hasht h=hashb(hashf, (u8*)&i, sizeof(i)); \ hasht h=hashb(hashf, (u8*)&i, sizeof(i)); \
bool col=false; \ bool col=false; \
Autoarr_foreach(hashes,e,({ \ Autoarr_foreach(hashes,e, \
if(e==h) { \ if(e==h) { \
col=true; \ col=true; \
break; \ break; \
} \ } \
})); \ ); \
if(col) collisions++; \ if(col) collisions++; \
else Autoarr_add(hashes,h); \ else Autoarr_add(hashes,h); \
} \ } \
kprintf("\e[93m%u \e[94mcollisions detected in %u hashes\n", collisions, COLLISION_TESTS); \ kprintf("\e[93m%u \e[94mcollisions detected in %u hashes\n", collisions, COLLISION_TESTS); \
})); \ ); \
Autoarr_free(hashes, true); \ Autoarr_free(hashes, true); \
kprintf("\e[96m--------------------------------------\n"); \ kprintf("\e[96m--------------------------------------\n"); \
}) }
void test_hash_functions(){ void test_hash_functions(){
optime("test_hash_functions",1,({ optime("test_hash_functions",1,
kprintf("\e[96m--------[test_hash_functions]---------\n"); kprintf("\e[96m--------[test_hash_functions]---------\n");
test_hashfunc(u32, hash_crc32); test_hashfunc(u32, hash_crc32);
test_hashfunc(u32, hash_sdbm32); test_hashfunc(u32, hash_sdbm32);
})); );
} }

View File

@ -62,7 +62,7 @@ Unitype gett(Hashtable* ht){
void test_hashtable(){ void test_hashtable(){
optime("test_hashtable",1,({ optime("test_hashtable",1,
kprintf("\e[96m-----------[test_hashtable]-----------\n"); kprintf("\e[96m-----------[test_hashtable]-----------\n");
Hashtable* ht=Hashtable_create(); Hashtable* ht=Hashtable_create();
kprintf("\e[92mhashtable created\n"); kprintf("\e[92mhashtable created\n");
@ -73,5 +73,5 @@ void test_hashtable(){
print_hashtable(ht); print_hashtable(ht);
Hashtable_free(ht); Hashtable_free(ht);
kprintf("\e[92mhashtable freed\n"); kprintf("\e[92mhashtable freed\n");
})); );
} }

View File

@ -2,7 +2,7 @@
#include "../src/random/krandom.h" #include "../src/random/krandom.h"
#define test_alg(ALG, VALUE_SIZE, EXPECTED_FROM_ZERO){ \ #define test_alg(ALG, VALUE_SIZE, EXPECTED_FROM_ZERO) { \
kprintf("\e[94mrng algorithm: \e[96m" #ALG "\n"); \ kprintf("\e[94mrng algorithm: \e[96m" #ALG "\n"); \
void* s= ALG##_init(0); \ void* s= ALG##_init(0); \
u##VALUE_SIZE r=ALG##_next(s); \ u##VALUE_SIZE r=ALG##_next(s); \
@ -20,7 +20,7 @@
} }
void test_rng_algorithms(){ void test_rng_algorithms(){
optime("test_rng_algorithms",1,({ optime("test_rng_algorithms",1,
kprintf("\e[96m--------[test_rng_algorithms]---------\n"); kprintf("\e[96m--------[test_rng_algorithms]---------\n");
// for ALG32 // for ALG32
// xoroshiro64 // xoroshiro64
@ -41,5 +41,5 @@ void test_rng_algorithms(){
test_alg(xoshiro256starstar, 64, 11091344671253066420ULL) test_alg(xoshiro256starstar, 64, 11091344671253066420ULL)
// splitmix64 // splitmix64
test_alg(splitmix64, 64, 16294208416658607535ULL) test_alg(splitmix64, 64, 16294208416658607535ULL)
})); );
} }

View File

@ -30,7 +30,7 @@ Maybe a(){ try(b(),_,;) return MaybeNull; }
void test_safethrow(){ void test_safethrow(){
kprintf("\e[96m-----------[test_safethrow]-----------\n"); kprintf("\e[96m-----------[test_safethrow]-----------\n");
optime("test_safethrow", 1, ({ optime("test_safethrow", 1,
Maybe e=test_maybe(); Maybe e=test_maybe();
kprintf("\e[94mthrow_error:\n\e[92m"); kprintf("\e[94mthrow_error:\n\e[92m");
printMaybe(e); printMaybe(e);
@ -39,5 +39,5 @@ void test_safethrow(){
e=a(); e=a();
printMaybe(e); printMaybe(e);
Maybe_free(e); Maybe_free(e);
})); );
} }

View File

@ -23,7 +23,7 @@ void printstnode(STNode* node){
} }
void test_searchtree(){ void test_searchtree(){
optime("test_searchtree",1,({ optime("test_searchtree",1,
kprintf("\e[96m-----------[test_searchtree]----------\n"); kprintf("\e[96m-----------[test_searchtree]----------\n");
STNode* node=STNode_create(); STNode* node=STNode_create();
kprintf("\e[92mnode created\n"); kprintf("\e[92mnode created\n");
@ -70,5 +70,5 @@ void test_searchtree(){
printstnode(node); printstnode(node);
STNode_free(node); STNode_free(node);
kprintf("\e[92mnode deleted\n"); kprintf("\e[92mnode deleted\n");
})); );
} }

View File

@ -2,7 +2,7 @@
#include "../src/String/string.h" #include "../src/String/string.h"
void test_string(){ void test_string(){
optime(__func__,1,({ optime(__func__,1,
kprintf("\e[96m-------------[test_string]------------\n"); kprintf("\e[96m-------------[test_string]------------\n");
char c[]="0123456789abcdef"; char c[]="0123456789abcdef";
string s={.ptr=c, .length=cptr_length(c)}; string s={.ptr=c, .length=cptr_length(c)};
@ -10,5 +10,5 @@ void test_string(){
char* p=string_extract(s); char* p=string_extract(s);
kprintf("\e[94mstring_extract() -> \e[92m\"%s\"\n",p); kprintf("\e[94mstring_extract() -> \e[92m\"%s\"\n",p);
free(p); free(p);
})); );
} }

View File

@ -21,7 +21,7 @@ void test_type_system();
inline void test_all(){ inline void test_all(){
kprintf("\e[97mkerep tests are starting!\n"); kprintf("\e[97mkerep tests are starting!\n");
optime(__func__, 1, ({ optime(__func__, 1,
test_type_system(); test_type_system();
test_string(); test_string();
test_safethrow(); test_safethrow();
@ -35,7 +35,7 @@ inline void test_all(){
test_hashtable(); test_hashtable();
test_dtsod(); test_dtsod();
kprintf("\e[96m--------------------------------------\e[0m\n"); kprintf("\e[96m--------------------------------------\e[0m\n");
})); );
} }
#define PRINT_SIZEOF(T) kprintf("\e[94m" #T " size: \e[96m" IFWIN("%llu", "%lu") "\n", sizeof(T)) #define PRINT_SIZEOF(T) kprintf("\e[94m" #T " size: \e[96m" IFWIN("%llu", "%lu") "\n", sizeof(T))