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:
@ -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);
|
||||
}
|
||||
|
||||
@ -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 */
|
||||
}
|
||||
|
||||
@ -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();
|
||||
|
||||
Reference in New Issue
Block a user