[ECOS] Is tm_basic broken?

Sergei Gavrikov sg@belvok.com
Tue Nov 18 10:46:00 GMT 2008


Hello,

tm_basic test does not work anymore with proper tidy max macro:
http://ecos.sourceware.org/ml/ecos-patches/2008-11/msg00041.html

old macro was :-)

#ifndef max
#define max(n,m) ((m) > (n) ? (n) : (m))
#endif

and a "calculator" is

#ifdef WORKHORSE_TEST
    ntest_threads = max(512, ntest_threads);
    nmutexes = max(1024, nmutexes);
    nsemaphores = max(1024, nsemaphores);
    nmboxes = max(1024, nmboxes);
    ncounters = max(1024, ncounters);
    nalarms = max(1024, nalarms);
#else
    ntest_threads = max(64, ntest_threads);
    nmutexes = max(32, nmutexes);
    nsemaphores = max(32, nsemaphores);
    nmboxes = max(32, nmboxes);
    ncounters = max(32, ncounters);
    nflags = max(32, nflags);
    nalarms = max(32, nalarms);
#endif

IMHO, all works in a decade because, the calculator should be

#ifdef WORKHORSE_TEST
    ntest_threads = min(512, ntest_threads);
    nmutexes = min(1024, nmutexes);
    nsemaphores = min(1024, nsemaphores);
    nmboxes = min(1024, nmboxes);
    ncounters = min(1024, ncounters);
    nalarms = min(1024, nalarms);
#else
    ntest_threads = min(64, ntest_threads);
    nmutexes = min(32, nmutexes);
    nsemaphores = min(32, nsemaphores);
    nmboxes = min(32, nmboxes);
    ncounters = min(32, ncounters);
    nflags = min(32, nflags);
    nalarms = min(32, nalarms);
#endif


May be I am wrong, but, with tidy max macro tm_basic does not work on my
small memory footprint target.

Sergei

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss



More information about the Ecos-discuss mailing list