Changeset 5513

Show
Ignore:
Timestamp:
05/11/08 14:16:28 (5 days ago)
Author:
morris
Message:

Add wi_pool_set_context() for more debug

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • libwired/trunk/libwired/misc/wi-pool.c

    r5412 r5513  
    7272        _wi_pool_array_t                                        *array; 
    7373         
     74        wi_string_t                                                     *context; 
    7475        wi_hash_t                                                       *locations; 
    7576}; 
     
    246247         
    247248        if(!stack) { 
    248                 wi_log_warn(WI_STR("Orphaned pool in thread %@"), wi_thread_current_thread()); 
     249                wi_log_warn(WI_STR("Orphaned pool in thread %@"), thread); 
    249250                 
    250251                return; 
     
    274275static void _wi_pool_invalid_abort(wi_pool_t *pool, wi_runtime_instance_t *instance) { 
    275276        if(pool->locations) { 
    276                 WI_ASSERT(0, "%p is not a valid instance: 0x%x (autoreleased at %@)", 
     277                WI_ASSERT(0, "%p is not a valid instance: 0x%x (context = %@, autoreleased at %@)", 
    277278                                  instance, 
    278279                                  WI_RUNTIME_BASE(instance)->magic, 
     280                                  pool->context, 
    279281                                  wi_hash_data_for_key(pool->locations, instance)); 
    280282        } else { 
    281                 WI_ASSERT(0, "%p is not a valid instance: 0x%x", 
     283                WI_ASSERT(0, "%p is not a valid instance: 0x%x (context = %@)", 
    282284                                  instance, 
    283                                   WI_RUNTIME_BASE(instance)->magic); 
     285                                  WI_RUNTIME_BASE(instance)->magic, 
     286                                  pool->context); 
    284287        } 
    285288} 
     
    297300wi_uinteger_t wi_pool_count(wi_pool_t *pool) { 
    298301        return pool->count; 
     302} 
     303 
     304 
     305 
     306#pragma mark - 
     307 
     308void wi_pool_set_context(wi_pool_t *pool, wi_string_t *context) { 
     309        wi_retain(context); 
     310        wi_release(pool->context); 
     311         
     312        pool->context = context; 
    299313} 
    300314 
  • libwired/trunk/libwired/misc/wi-pool.h

    r5412 r5513  
    4848WI_EXPORT wi_uinteger_t                         wi_pool_count(wi_pool_t *); 
    4949 
     50WI_EXPORT void                                          wi_pool_set_context(wi_pool_t *, wi_string_t *); 
     51 
    5052WI_EXPORT wi_runtime_instance_t *       _wi_autorelease(wi_runtime_instance_t *, const char *, wi_uinteger_t); 
    5153