Ignore:
Timestamp:
Jul 12, 2008 9:31:34 AM (16 years ago)
Author:
bennylp
Message:

Ticket 559 (minor): Update the pool alternative API (pool_alt.h) with the latest pool API

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/src/pj/pool_dbg.c

    r2039 r2123  
    2020#include <pj/string.h> 
    2121 
    22 #if PJ_POOL_DEBUG 
     22#if PJ_HAS_POOL_ALT_API 
    2323 
    2424#if PJ_HAS_MALLOC_H 
     
    4242 
    4343 
    44 struct pj_pool_mem 
    45 { 
    46     struct pj_pool_mem *next; 
    47  
    48     /* data follows immediately */ 
    49 }; 
    50  
    51  
    52 struct pj_pool_t 
    53 { 
    54     struct pj_pool_mem *first_mem; 
    55     pj_size_t           used_size; 
    56     pj_pool_callback   *cb; 
    57 }; 
    58  
    5944 
    6045int PJ_NO_MEMORY_EXCEPTION; 
    6146 
     47 
     48PJ_DEF(int) pj_NO_MEMORY_EXCEPTION() 
     49{ 
     50    return PJ_NO_MEMORY_EXCEPTION; 
     51} 
    6252 
    6353/* Create pool */ 
     
    7464    PJ_UNUSED_ARG(line); 
    7565    PJ_UNUSED_ARG(factory); 
    76     PJ_UNUSED_ARG(name); 
    7766    PJ_UNUSED_ARG(initial_size); 
    7867    PJ_UNUSED_ARG(increment_size); 
     
    8271        return NULL; 
    8372 
     73    if (name) { 
     74        pj_ansi_strncpy(pool->obj_name, name, sizeof(pool->obj_name)); 
     75        pool->obj_name[sizeof(pool->obj_name)-1] = '\0'; 
     76    } else { 
     77        strcpy(pool->obj_name, "altpool"); 
     78    } 
     79 
     80    pool->factory = NULL; 
    8481    pool->first_mem = NULL; 
    8582    pool->used_size = 0; 
     
    185182                                  pj_pool_t *pool, pj_size_t sz) 
    186183{ 
    187     return pj_pool_calloc_imp(file, line, pool, 1, sz); 
     184    return pj_pool_calloc_imp(file, line, pool, 1, sz);  
    188185} 
    189186 
    190187 
    191 #endif  /* PJ_POOL_DEBUG */ 
     188 
     189#endif  /* PJ_HAS_POOL_ALT_API */ 
Note: See TracChangeset for help on using the changeset viewer.