1
0
mirror of https://github.com/adtools/clib2.git synced 2025-12-08 14:59:05 +00:00

Added code which temporarily disables profiling

This commit is contained in:
obarthel
2016-12-04 11:06:50 +01:00
parent 78a8c7655e
commit 17ba18c731
3 changed files with 35 additions and 18 deletions

View File

@ -79,6 +79,8 @@ DoTimer(struct timeval *tv,LONG unit,LONG command)
struct MsgPort * mp;
LONG error;
PROFILE_OFF();
assert( tv != NULL );
#if defined(__amigaos4__)
@ -129,14 +131,10 @@ DoTimer(struct timeval *tv,LONG unit,LONG command)
tr->tr_time.tv_secs = tv->tv_secs;
tr->tr_time.tv_micro = tv->tv_micro;
PROFILE_OFF();
SetSignal(0,(1UL << mp->mp_SigBit));
error = DoIO((struct IORequest *)tr);
PROFILE_ON();
tv->tv_secs = tr->tr_time.tv_secs;
tv->tv_micro = tr->tr_time.tv_micro;
@ -161,5 +159,7 @@ DoTimer(struct timeval *tv,LONG unit,LONG command)
}
#endif /* __amigaos4__ */
PROFILE_ON();
return(error);
}

View File

@ -374,44 +374,57 @@ remove_and_free_memory_node(struct MemoryNode * mn)
#if defined(__USE_SLAB_ALLOCATOR)
{
/* Are we using the slab allocator? */
if (__slab_data.sd_InUse)
if(__slab_data.sd_InUse)
{
__slab_free(mn,allocation_size);
}
else if (__memory_pool != NULL)
{
FreePooled(__memory_pool,mn,allocation_size);
}
else
{
#if defined(__MEM_DEBUG)
if(__memory_pool != NULL)
{
FreeMem(mn,allocation_size);
PROFILE_OFF();
FreePooled(__memory_pool,mn,allocation_size);
PROFILE_ON();
}
#else
else
{
struct MinNode * mln = (struct MinNode *)mn;
#if defined(__MEM_DEBUG)
{
PROFILE_OFF();
FreeMem(mn,allocation_size);
PROFILE_ON();
}
#else
{
struct MinNode * mln = (struct MinNode *)mn;
mln--;
mln--;
Remove((struct Node *)mln);
Remove((struct Node *)mln);
FreeMem(mln,sizeof(*mln) + allocation_size);
PROFILE_OFF();
FreeMem(mln,sizeof(*mln) + allocation_size);
PROFILE_ON();
}
#endif /* __MEM_DEBUG */
}
#endif /* __MEM_DEBUG */
}
}
#else
{
if (__memory_pool != NULL)
if(__memory_pool != NULL)
{
PROFILE_OFF();
FreePooled(__memory_pool,mn,allocation_size);
PROFILE_ON();
}
else
{
#if defined(__MEM_DEBUG)
{
PROFILE_OFF();
FreeMem(mn,allocation_size);
PROFILE_ON();
}
#else
{
@ -421,7 +434,9 @@ remove_and_free_memory_node(struct MemoryNode * mn)
Remove((struct Node *)mln);
PROFILE_OFF();
FreeMem(mln,sizeof(*mln) + allocation_size);
PROFILE_ON();
}
#endif /* __MEM_DEBUG */
}

View File

@ -72,7 +72,9 @@ __free_unused_slabs(void)
/* Unlink from list of slabs of the same size. */
Remove((struct Node *)sn);
PROFILE_OFF();
FreeVec(sn);
PROFILE_ON();
}
__memory_unlock();