diff options
author | Benny Prijono <bennylp@teluu.com> | 2007-12-28 19:03:20 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2007-12-28 19:03:20 +0000 |
commit | 5e3f383aec22e1b67cc7cb1eb0dcc0a6da60ae6d (patch) | |
tree | 4bcec6f5ce24cf093d04993259b5a8d09e3265a4 /pjlib/src/pjlib-test | |
parent | 8fae955b81af4c3fab42d984c3885528ae806251 (diff) |
Set pool_test_malloc_free() to use malloc()/free() instead of new/delete since there is compilation error on Symbian with GCCE compiler. But this most likely will fail on run-time, so currently this test is broken for Symbian
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1643 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib/src/pjlib-test')
-rw-r--r-- | pjlib/src/pjlib-test/pool_perf.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/pjlib/src/pjlib-test/pool_perf.c b/pjlib/src/pjlib-test/pool_perf.c index c65b6e40..32487763 100644 --- a/pjlib/src/pjlib-test/pool_perf.c +++ b/pjlib/src/pjlib-test/pool_perf.c @@ -61,27 +61,29 @@ static int pool_test_pool() } /* Symbian doesn't have malloc()/free(), so we use new/delete instead */ -#if defined(PJ_SYMBIAN) && PJ_SYMBIAN != 0 - +//#if defined(PJ_SYMBIAN) && PJ_SYMBIAN != 0 +#if 0 static int pool_test_malloc_free() { int i; /* must be signed */ for (i=0; i<COUNT; ++i) { - p[i] = new char[sizes[i]]; - if (!p[i]) { - PJ_LOG(3,(THIS_FILE," error: malloc failed to allocate %d bytes", - sizes[i])); - --i; - while (i >= 0) - delete [] p[i], --i; - return -1; - } - *p[i] = '\0'; + p[i] = new char[sizes[i]]; + if (!p[i]) { + PJ_LOG(3,(THIS_FILE," error: malloc failed to allocate %d bytes", + sizes[i])); + --i; + while (i >= 0) { + delete [] p[i]; + --i; + } + return -1; + } + *p[i] = '\0'; } for (i=0; i<COUNT; ++i) { - delete [] p[i]; + delete [] p[i]; } return 0; |