Changeset 5412
- Timestamp:
- 03/15/08 16:21:37 (4 months ago)
- Files:
-
- libwired/trunk/libwired/misc/wi-pool.c (modified) (5 diffs)
- libwired/trunk/libwired/misc/wi-pool.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
libwired/trunk/libwired/misc/wi-pool.c
r5306 r5412 136 136 137 137 wi_pool_t * wi_pool_init(wi_pool_t *pool) { 138 return wi_pool_init_with_debug(pool, true); 139 } 140 141 142 143 wi_pool_t * wi_pool_init_with_debug(wi_pool_t *pool, wi_boolean_t debug) { 138 144 _wi_pool_add_pool(pool); 139 145 140 if(wi_pool_debug ) {146 if(wi_pool_debug && debug) { 141 147 pool->locations = wi_hash_init_with_capacity_and_callbacks(wi_hash_alloc(), 142 148 200, wi_hash_null_key_callbacks, wi_hash_default_value_callbacks); … … 214 220 instance = *instances++; 215 221 216 if(wi_pool_debug) { 217 if(WI_RUNTIME_BASE(instance)->magic != WI_RUNTIME_MAGIC) 218 _wi_pool_invalid_abort(pool, instance); 219 } 222 if(WI_RUNTIME_BASE(instance)->magic != WI_RUNTIME_MAGIC) 223 _wi_pool_invalid_abort(pool, instance); 220 224 221 225 wi_release(instance); … … 228 232 pool->array = NULL; 229 233 230 if( wi_pool_debug)234 if(pool->locations) 231 235 wi_hash_remove_all_data(pool->locations); 232 236 } … … 269 273 270 274 static void _wi_pool_invalid_abort(wi_pool_t *pool, wi_runtime_instance_t *instance) { 271 if( wi_pool_debug) {275 if(pool->locations) { 272 276 WI_ASSERT(0, "%p is not a valid instance: 0x%x (autoreleased at %@)", 273 277 instance, … … 334 338 pool->count++; 335 339 336 if( wi_pool_debug) {340 if(pool->locations) { 337 341 location = wi_hash_data_for_key(pool->locations, instance); 338 342 libwired/trunk/libwired/misc/wi-pool.h
r5231 r5412 43 43 WI_EXPORT wi_pool_t * wi_pool_alloc(void); 44 44 WI_EXPORT wi_pool_t * wi_pool_init(wi_pool_t *); 45 WI_EXPORT wi_pool_t * wi_pool_init_with_debug(wi_pool_t *, wi_boolean_t); 45 46 46 47 WI_EXPORT void wi_pool_drain(wi_pool_t *);
