dynamic profile zone with raddbg sprintf

This commit is contained in:
Nikita Smith
2024-11-12 13:18:17 -08:00
parent 9808157f45
commit bc446d8520
+10
View File
@@ -43,6 +43,15 @@
# define ProfLockTake(...) tmAcquiredLock(0, 0, __VA_ARGS__) # define ProfLockTake(...) tmAcquiredLock(0, 0, __VA_ARGS__)
# define ProfLockDrop(...) tmReleasedLock(0, __VA_ARGS__) # define ProfLockDrop(...) tmReleasedLock(0, __VA_ARGS__)
# define ProfColor(color) tmZoneColorSticky(color) # define ProfColor(color) tmZoneColorSticky(color)
# define ProfBeginV(...) \
if (TM_API_PTR) { \
static tm_uint64 file_id = 0; TM_API_PTR->_tmStaticString(&file_id, __FILE__); \
Temp scratch = scratch_begin(0,0); \
String8 string = push_str8f(scratch.arena, __VA_ARGS__); \
tm_uint64 hash = TM_API_PTR->_tmPrintf("%.*s", str8_varg(string)); \
TM_API_PTR->_tmEnterZoneFast_Core(0, 0, file_id, __LINE__, hash); \
scratch_end(scratch); \
}
#endif #endif
//////////////////////////////// ////////////////////////////////
@@ -63,6 +72,7 @@
# define ProfLockTake(...) (0) # define ProfLockTake(...) (0)
# define ProfLockDrop(...) (0) # define ProfLockDrop(...) (0)
# define ProfColor(...) (0) # define ProfColor(...) (0)
# define ProfBeginV(...) (0)
#endif #endif
//////////////////////////////// ////////////////////////////////