Speed up ll_assert_aligned

Although only used in Debug mode, this showed up in a profiling
with a very significant amount of CPU cycles (in a state when
the viewer bogged down to 1 FPS because of drawing terrain,
but still - significant compared to the code that was being
executed (ie, 10%)).

This patch should bring that down from a few hunderd to one clock
cycle.
This commit is contained in:
Aleric Inglewood
2013-11-26 17:46:51 +01:00
parent f8d9bcf487
commit 8357a2b90b
2 changed files with 29 additions and 11 deletions

View File

@@ -61,17 +61,13 @@ BOOL LLMemory::sEnableMemoryFailurePrevention = FALSE;
LLPrivateMemoryPoolManager::mem_allocation_info_t LLPrivateMemoryPoolManager::sMemAllocationTracker;
#endif
void ll_assert_aligned_func(uintptr_t ptr,U32 alignment)
{
#ifdef SHOW_ASSERT
void singu_alignment_check_failed(void)
{
// Redundant, place to set breakpoints.
if (ptr%alignment!=0)
{
llwarns << "alignment check failed" << llendl;
}
llassert(ptr%alignment==0);
#endif
llassert(false);
}
#endif
//static
void LLMemory::initClass()