Ignore:
Timestamp:
May 1, 2007 10:42:22 AM (14 years ago)
Author:
bennylp
Message:

Ported PJLIB and PJLIB-TEST to Symbian!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/src/pjlib-test/pool_perf.c

    r974 r1238  
    6161} 
    6262 
     63/* Symbian doesn't have malloc()/free(), so we use new/delete instead */ 
     64#if defined(PJ_SYMBIAN) && PJ_SYMBIAN != 0 
     65 
     66static int pool_test_malloc_free() 
     67{ 
     68    int i; /* must be signed */ 
     69 
     70    for (i=0; i<COUNT; ++i) { 
     71        p[i] = new char[sizes[i]]; 
     72        if (!p[i]) { 
     73            PJ_LOG(3,(THIS_FILE,"   error: malloc failed to allocate %d bytes", 
     74                      sizes[i])); 
     75            --i; 
     76            while (i >= 0) 
     77                delete [] p[i], --i; 
     78            return -1; 
     79        } 
     80        *p[i] = '\0'; 
     81    } 
     82 
     83    for (i=0; i<COUNT; ++i) { 
     84        delete [] p[i]; 
     85    } 
     86 
     87    return 0; 
     88} 
     89 
     90#else   /* PJ_SYMBIAN */ 
     91 
    6392static int pool_test_malloc_free() 
    6493{ 
     
    84113    return 0; 
    85114} 
     115 
     116#endif /* PJ_SYMBIAN */ 
    86117 
    87118int pool_perf_test() 
     
    141172    else 
    142173        best = pool_time2, worst = pool_time; 
     174     
     175    /* avoid division by zero */ 
     176    if (best==0) best=1; 
     177    if (worst==0) worst=1; 
    143178 
    144179    PJ_LOG(3, (THIS_FILE, "..pool speedup over malloc best=%dx, worst=%dx",  
Note: See TracChangeset for help on using the changeset viewer.