> -----Original Message-----

> From: Christophe Jaillet [mailto:christophe.jaillet@wanadoo.fr]
> Sent: Saturday, October 17, 2009 9:02 AM
> To: submit@mamedev.org
> Subject: Correct 3 unbalanced calls to 'profiler_mark_start' and
> improve warning message
> 
> Hi,
> 
> while profiling the game 'silentd', I found some 'FILO overflow'
> warning.
> 
> This was linked to 2 different unbalanced 'profiler_mark_start' calls.
> 
> The attached patch does the folowing :
>     - add a missing 'profiler_mark_end' call in 'drawgfxm.h'
>     - add a missing 'profiler_mark_end' call in 'video/taito_b.c'. I
> think
> that this one could probably be completely removed
>     - add a missing 'profiler_mark_end' call in 'profiler.c'. This one
> is
> very unlikely to happen. This has been done by rearranging a bit the
> code in
> order to have only one exit in the function
>     - add more information about the likely type of profiling data that
> has
> made the fifo overflow. (This is that information that has help me find
> the
> two first issues).
> 
> Hope this help.
> Best regards,
> 
> CJ
This commit is contained in:
Aaron Giles 2009-10-25 05:08:04 +00:00
parent c96cde525f
commit a7d62ae961
3 changed files with 13 additions and 5 deletions

View File

@ -701,7 +701,10 @@ do { \
/* compute final pixel in Y and exit if we are entirely clipped */ \
destendy = desty + dstheight - 1; \
if (desty > cliprect->max_y || destendy < cliprect->min_y) \
{ \
profiler_mark_end(); \
return; \
} \
\
/* apply top clip */ \
srcy = 0; \

View File

@ -62,7 +62,7 @@ void _profiler_mark_start(int type)
/* fail if we overflow */
if (index > ARRAY_LENGTH(global_profiler.filo))
fatalerror("Profiler FILO overflow\n");
fatalerror("Profiler FILO overflow (type = %d)\n", type);
/* if we're nested, stop the previous entry */
if (index > 0)
@ -162,7 +162,7 @@ astring *_profiler_get_text(running_machine *machine, astring *string)
total = computed;
astring_reset(string);
if (total == 0 || normalize == 0)
return string;
goto out;
/* loop over all types and generate the string */
for (curtype = 0; curtype < PROFILER_TOTAL; curtype++)
@ -209,8 +209,6 @@ astring *_profiler_get_text(running_machine *machine, astring *string)
astring_catprintf(string, "%d CPU switches\n", switches / (int) ARRAY_LENGTH(global_profiler.data));
}
profiler_mark_end();
/* advance to the next dataset and reset it to 0 */
global_profiler.dataindex = (global_profiler.dataindex + 1) % ARRAY_LENGTH(global_profiler.data);
memset(&global_profiler.data[global_profiler.dataindex], 0, sizeof(global_profiler.data[global_profiler.dataindex]));
@ -219,5 +217,8 @@ astring *_profiler_get_text(running_machine *machine, astring *string)
if (global_profiler.dataindex == 0)
global_profiler.dataready = TRUE;
out:
profiler_mark_end();
return string;
}

View File

@ -503,7 +503,11 @@ profiler_mark_start(PROFILER_USER1);
if (video_control & 0x08)
{
if (priority) return;
if (priority)
{
profiler_mark_end();
return;
}
if (video_control & 0x10) /*flip screen*/
{