Previous 199869 Revisions Next

r34260 Thursday 8th January, 2015 at 09:55:56 UTC by Oliver Stöneberg
osd_work: moved thread count printing to KEEP_STATISTICS / prevent KEEP_STATISTICS loop from going out-of-bounds (nw)
[src/osd/modules/sync]work_osd.c

trunk/src/osd/modules/sync/work_osd.c
r242771r242772
223223      allocthreadnum = queue->threads + 1;
224224   else
225225      allocthreadnum = queue->threads;
226#if 0
227   // tools like chdman are not linked with osd_printf_*
228   osd_printf_verbose("osdprocs: %d effecprocs: %d threads: %d allocthreads: %d osdthreads: %d maxthreads: %d queuethreads: %d\n", osd_num_processors, numprocs, threadnum, allocthreadnum, osdthreadnum, WORK_MAX_THREADS, queue->threads);
226
227#if KEEP_STATISTICS
228   printf("osdprocs: %d effecprocs: %d threads: %d allocthreads: %d osdthreads: %d maxthreads: %d queuethreads: %d\n", osd_num_processors, numprocs, threadnum, allocthreadnum, osdthreadnum, WORK_MAX_THREADS, queue->threads);
229229#endif
230
230231   queue->thread = (work_thread_info *)osd_malloc_array(allocthreadnum * sizeof(queue->thread[0]));
231232   if (queue->thread == NULL)
232233      goto error;
r242771r242772
382383         allocthreadnum = queue->threads;
383384
384385      // output per-thread statistics
385      for (threadnum = 0; threadnum <= allocthreadnum; threadnum++)
386      for (threadnum = 0; threadnum < allocthreadnum; threadnum++)
386387      {
387388         work_thread_info *thread = &queue->thread[threadnum];
388389         osd_ticks_t total = thread->runtime + thread->waittime + thread->spintime;


Previous 199869 Revisions Next


© 1997-2024 The MAME Team