Changeset 31259 in vbox for trunk/src/libs/xpcom18a4/xpcom
- Timestamp:
- Jul 30, 2010 8:02:05 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 64275
- Location:
- trunk/src/libs/xpcom18a4/xpcom
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/xpcom18a4/xpcom/components/xcDll.cpp
r1 r31259 74 74 75 75 #include "nsNativeComponentLoader.h" 76 #ifdef VBOX_USE_IPRT_IN_XPCOM 77 # include "nsMemory.h" 78 #endif 76 79 77 80 nsDll::nsDll(nsIFile *dllSpec, nsNativeComponentLoader *loader) 78 81 : m_dllSpec(do_QueryInterface(dllSpec)), 79 m_instance(NULL), 82 m_instance(NULL), 80 83 m_moduleObject(NULL), 81 84 m_loader(loader), … … 102 105 { 103 106 m_dllSpec->GetNativeLeafName(aLeafName); 104 107 105 108 if (aLeafName.IsEmpty()) 106 109 aLeafName.AssignLiteral("unknown!"); … … 120 123 return PR_TRUE; 121 124 PRBool changed = PR_TRUE; 122 manager->HasFileChanged(m_dllSpec, nsnull, currentDate, &changed); 125 manager->HasFileChanged(m_dllSpec, nsnull, currentDate, &changed); 123 126 return changed; 124 127 } … … 137 140 nsTraceRefcntImpl::SetActivityIsLegal(PR_FALSE); 138 141 #endif 139 142 140 143 // Load any library dependencies 141 144 // The Component Loader Manager may hold onto some extra data 142 // set by either the native component loader or the native 145 // set by either the native component loader or the native 143 146 // component. We assume that this data is a space delimited 144 147 // listing of dependent libraries which are required to be 145 148 // loaded prior to us loading the given component. Once, the 146 // component is loaded into memory, we can release our hold 147 // on the dependent libraries with the assumption that the 149 // component is loaded into memory, we can release our hold 150 // on the dependent libraries with the assumption that the 148 151 // component library holds a reference via the OS so loader. 149 152 … … 155 158 nsXPIDLCString extraData; 156 159 manager->GetOptionalData(m_dllSpec, nsnull, getter_Copies(extraData)); 157 160 158 161 #ifdef UNLOAD_DEPENDENT_LIBS 159 162 nsVoidArray dependentLibArray; … … 161 164 162 165 // if there was any extra data, treat it as a listing of dependent libs 163 if (extraData != nsnull) 166 if (extraData != nsnull) 164 167 { 165 168 // all dependent libraries are suppose to be in the "gre" directory. 166 // note that the gre directory is the same as the "bin" directory, 169 // note that the gre directory is the same as the "bin" directory, 167 170 // when there isn't a real "gre" found. 168 171 … … 170 173 nsCOMPtr<nsIFile> file; 171 174 NS_GetSpecialDirectory(NS_GRE_DIR, getter_AddRefs(file)); 172 175 173 176 if (!file) 174 177 return NS_ERROR_FAILURE; … … 178 181 file->AppendNative(NS_LITERAL_CSTRING("dummy")); 179 182 180 char *buffer = strdup(extraData); 183 # ifdef VBOX_USE_IPRT_IN_XPCOM 184 char *buffer = (char *)nsMemory::Clone(extraData, strlen(extraData) + 1); 185 # else 186 char *buffer = strdup(extraData); 187 # endif 181 188 if (!buffer) 182 189 return NS_ERROR_OUT_OF_MEMORY; … … 200 207 return NS_ERROR_FAILURE; 201 208 202 // Load this dependent library with the global flag and stash 209 // Load this dependent library with the global flag and stash 203 210 // the result for later so that we can unload it. 204 211 PRLibSpec libSpec; 205 212 libSpec.type = PR_LibSpec_Pathname; 206 213 207 // if the depend library path starts with a / we are 214 // if the depend library path starts with a / we are 208 215 // going to assume that it is a full path and should 209 // be loaded without prepending the gre diretory 210 // location. We could have short circuited the 216 // be loaded without prepending the gre diretory 217 // location. We could have short circuited the 211 218 // SetNativeLeafName above, but this is clearer and 212 219 // the common case is a relative path. … … 216 223 else 217 224 libSpec.value.pathname = path; 218 225 219 226 PRLibrary* lib = PR_LoadLibraryWithFlags(libSpec, PR_LD_LAZY|PR_LD_GLOBAL); 220 227 // if we couldn't load the dependent library. We did the best we … … 222 229 // dependency. 223 230 #ifdef UNLOAD_DEPENDENT_LIBS 224 if (lib) 231 if (lib) 225 232 dependentLibArray.AppendElement((void*)lib); 226 233 #endif 227 234 228 235 token = nsCRT::strtok(newStr, " ", &newStr); 229 236 } 237 # ifdef VBOX_USE_IPRT_IN_XPCOM 238 nsMemory::Free(buffer); 239 # else 230 240 free(buffer); 241 # endif 231 242 } 232 243 #endif … … 234 245 // load the component 235 246 nsCOMPtr<nsILocalFile> lf(do_QueryInterface(m_dllSpec)); 236 NS_ASSERTION(lf, "nsIFile here must implement a nsILocalFile"); 247 NS_ASSERTION(lf, "nsIFile here must implement a nsILocalFile"); 237 248 lf->Load(&m_instance); 238 249 239 250 #if defined(XP_UNIX) 240 // Unload any of library dependencies we loaded earlier. The assumption 251 // Unload any of library dependencies we loaded earlier. The assumption 241 252 // here is that the component will have a "internal" reference count to 242 // the dependency library we just loaded. 253 // the dependency library we just loaded. 243 254 // XXX should we unload later - or even at all? 244 255 … … 306 317 if (symbol == NULL) 307 318 return (NULL); 308 319 309 320 // If not already loaded, load it now. 310 321 if (Load() != PR_TRUE) -
trunk/src/libs/xpcom18a4/xpcom/ds/nsRecyclingAllocator.cpp
r1 r31259 49 49 #include "prprf.h" 50 50 #include "nsITimer.h" 51 #ifdef VBOX_USE_IPRT_IN_XPCOM 52 # include <iprt/mem.h> 53 #endif 51 54 52 55 #define NS_SEC_TO_MS(s) ((s) * 1000) … … 103 106 while(mFreeList) 104 107 { 108 #ifdef VBOX_USE_IPRT_IN_XPCOM 109 RTMemFree(mFreeList->block); 110 #else 105 111 free(mFreeList->block); 112 #endif 106 113 mFreeList = mFreeList->next; 107 114 } 108 115 mFreeList = nsnull; 109 116 110 117 if (mBlocks) 111 118 delete [] mBlocks; … … 143 150 while(mFreeList) 144 151 { 152 #ifdef VBOX_USE_IPRT_IN_XPCOM 153 RTMemFree(mFreeList->block); 154 #else 145 155 free(mFreeList->block); 156 #endif 146 157 mFreeList = mFreeList->next; 147 158 } 148 159 mFreeList = nsnull; 149 160 150 161 if (mBlocks) 151 162 delete [] mBlocks; … … 165 176 // timer based release of unused memory. 166 177 Touch(); 167 178 168 179 Block* freeBlock = FindFreeBlock(bytes); 169 180 if (freeBlock) … … 175 186 return data; 176 187 } 177 188 178 189 // We need to do an allocation 179 190 // Add 4 bytes to what we allocate to hold the bucket index 180 191 PRSize allocBytes = bytes + NS_ALLOCATOR_OVERHEAD_BYTES; 181 192 182 193 // We dont have that memory already. Allocate. 194 #ifdef VBOX_USE_IPRT_IN_XPCOM 195 Block *ptr = (Block *) (zeroit ? RTMemAllocZ(allocBytes) : RTMemAlloc(allocBytes)); 196 #else 183 197 Block *ptr = (Block *) (zeroit ? calloc(1, allocBytes) : malloc(allocBytes)); 184 198 #endif 199 185 200 // Deal with no memory situation 186 201 if (!ptr) 187 202 return ptr; 188 203 189 204 // This is the first allocation we are holding. 190 205 // Setup timer for releasing memory … … 194 209 if (mRecycleAfter && !mRecycleTimer) 195 210 { 196 // known only to stuff in xpcom. 211 // known only to stuff in xpcom. 197 212 extern nsresult NS_NewTimer(nsITimer* *aResult, nsTimerCallbackFunc aCallback, void *aClosure, 198 213 PRUint32 aDelay, PRUint32 aType); 199 214 200 (void) NS_NewTimer(&mRecycleTimer, nsRecycleTimerCallback, this, 215 (void) NS_NewTimer(&mRecycleTimer, nsRecycleTimerCallback, this, 201 216 NS_SEC_TO_MS(mRecycleAfter), 202 217 nsITimer::TYPE_REPEATING_SLACK); 203 218 NS_ASSERTION(mRecycleTimer, "nsRecyclingAllocator: Creating timer failed.\n"); 204 219 } 205 220 206 221 #ifdef DEBUG 207 222 mNAllocated++; 208 223 #endif 209 224 210 225 // Store size and return data portion 211 226 ptr->bytes = bytes; … … 235 250 mNAllocated--; 236 251 #endif 252 #ifdef VBOX_USE_IPRT_IN_XPCOM 253 RTMemFree(block); 254 #else 237 255 free(block); 256 #endif 238 257 } 239 258 } … … 257 276 { 258 277 // Free the allocated block 278 #ifdef VBOX_USE_IPRT_IN_XPCOM 279 RTMemFree(node->block); 280 #else 259 281 free(node->block); 282 #endif 260 283 261 284 #ifdef DEBUG_dp … … 275 298 mFreeList = nsnull; 276 299 277 #ifdef DEBUG 300 #ifdef DEBUG 278 301 mNAllocated = 0; 279 302 #endif -
trunk/src/libs/xpcom18a4/xpcom/ds/pldhash.c
r11278 r31259 57 57 # define METER(x) /* nothing */ 58 58 #endif 59 #ifdef VBOX_USE_IPRT_IN_XPCOM 60 # include <iprt/mem.h> 61 #endif 59 62 60 63 PR_IMPLEMENT(void *) 61 64 PL_DHashAllocTable(PLDHashTable *table, PRUint32 nbytes) 62 65 { 66 #ifdef VBOX_USE_IPRT_IN_XPCOM 67 return RTMemAlloc(nbytes); 68 #else 63 69 return malloc(nbytes); 70 #endif 64 71 } 65 72 … … 67 74 PL_DHashFreeTable(PLDHashTable *table, void *ptr) 68 75 { 76 #ifdef VBOX_USE_IPRT_IN_XPCOM 77 RTMemFree(ptr); 78 #else 69 79 free(ptr); 80 #endif 70 81 } 71 82 … … 137 148 const PLDHashEntryStub *stub = (const PLDHashEntryStub *)entry; 138 149 150 #ifdef VBOX_USE_IPRT_IN_XPCOM 151 RTMemFree((void *) stub->key); 152 #else 139 153 free((void *) stub->key); 154 #endif 140 155 memset(entry, 0, table->entrySize); 141 156 } … … 170 185 PLDHashTable *table; 171 186 187 #ifdef VBOX_USE_IPRT_IN_XPCOM 188 table = (PLDHashTable *) RTMemAlloc(sizeof *table); 189 #else 172 190 table = (PLDHashTable *) malloc(sizeof *table); 191 #endif 173 192 if (!table) 174 193 return NULL; 175 194 if (!PL_DHashTableInit(table, ops, data, entrySize, capacity)) { 195 #ifdef VBOX_USE_IPRT_IN_XPCOM 196 RTMemFree(table); 197 #else 176 198 free(table); 199 #endif 177 200 return NULL; 178 201 } … … 184 207 { 185 208 PL_DHashTableFinish(table); 209 #ifdef VBOX_USE_IPRT_IN_XPCOM 210 RTMemFree(table); 211 #else 186 212 free(table); 213 #endif 187 214 } 188 215 -
trunk/src/libs/xpcom18a4/xpcom/proxy/src/nsProxyEvent.cpp
r1 r31259 76 76 77 77 static NS_DEFINE_CID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID); 78 78 79 79 static void* PR_CALLBACK EventHandler(PLEvent *self); 80 80 static void PR_CALLBACK DestroyHandler(PLEvent *self); … … 86 86 nsProxyObjectCallInfo::nsProxyObjectCallInfo( nsProxyObject* owner, 87 87 nsXPTMethodInfo *methodInfo, 88 PRUint32 methodIndex, 89 nsXPTCVariant* parameterList, 90 PRUint32 parameterCount, 88 PRUint32 methodIndex, 89 nsXPTCVariant* parameterList, 90 PRUint32 parameterCount, 91 91 PLEvent *event) 92 92 { … … 94 94 NS_ASSERTION(methodInfo, "No nsXPTMethodInfo!"); 95 95 NS_ASSERTION(event, "No PLEvent!"); 96 96 97 97 mCompleted = 0; 98 98 mMethodIndex = methodIndex; … … 104 104 105 105 mOwner = owner; 106 106 107 107 RefCountInInterfacePointers(PR_TRUE); 108 108 if (mOwner->GetProxyType() & PROXY_ASYNC) … … 118 118 119 119 mOwner = nsnull; 120 120 121 121 PR_FREEIF(mEvent); 122 123 if (mParameterList) 122 123 if (mParameterList) 124 #ifdef VBOX_USE_IPRT_IN_XPCOM 125 nsMemory::Free((void*) mParameterList); 126 #else 124 127 free( (void*) mParameterList); 128 #endif 125 129 } 126 130 … … 139 143 { 140 144 anInterface = ((nsISupports*)mParameterList[i].val.p); 141 145 142 146 if (anInterface) 143 147 { … … 146 150 else 147 151 anInterface->Release(); 148 152 149 153 } 150 154 } … … 170 174 171 175 if (copy) 172 { 173 switch (type_tag) 176 { 177 switch (type_tag) 174 178 { 175 case nsXPTType::T_CHAR_STR: 179 case nsXPTType::T_CHAR_STR: 176 180 mParameterList[i].val.p = 177 181 PL_strdup((const char *)ptr); … … 183 187 case nsXPTType::T_DOMSTRING: 184 188 case nsXPTType::T_ASTRING: 185 mParameterList[i].val.p = 189 mParameterList[i].val.p = 186 190 new nsString(*((nsAString*) ptr)); 187 191 break; 188 192 case nsXPTType::T_CSTRING: 189 mParameterList[i].val.p = 193 mParameterList[i].val.p = 190 194 new nsCString(*((nsACString*) ptr)); 191 195 break; 192 case nsXPTType::T_UTF8STRING: 193 mParameterList[i].val.p = 196 case nsXPTType::T_UTF8STRING: 197 mParameterList[i].val.p = 194 198 new nsUTF8String(*((nsAUTF8String*) ptr)); 195 199 break; 196 200 default: 197 201 // Other types are ignored 198 break; 202 break; 199 203 } 200 204 } 201 205 else 202 206 { 203 switch (type_tag) 207 switch (type_tag) 204 208 { 205 209 case nsXPTType::T_CHAR_STR: … … 226 230 } 227 231 228 PRBool 232 PRBool 229 233 nsProxyObjectCallInfo::GetCompleted() 230 234 { … … 238 242 } 239 243 240 void 244 void 241 245 nsProxyObjectCallInfo::PostCompleted() 242 246 { … … 244 248 { 245 249 PLEvent *event = PR_NEW(PLEvent); 246 247 PL_InitEvent(event, 250 251 PL_InitEvent(event, 248 252 this, 249 253 CompletedEventHandler, 250 254 CompletedDestroyHandler); 251 255 252 256 mCallersEventQ->PostSynchronousEvent(event, nsnull); 253 257 PR_FREEIF(event); … … 259 263 } 260 264 } 261 262 nsIEventQueue* 263 nsProxyObjectCallInfo::GetCallersQueue() 264 { 265 266 nsIEventQueue* 267 nsProxyObjectCallInfo::GetCallersQueue() 268 { 265 269 return mCallersEventQ; 266 } 270 } 267 271 void 268 272 nsProxyObjectCallInfo::SetCallersQueue(nsIEventQueue* queue) 269 273 { 270 274 mCallersEventQ = queue; 271 } 275 } 272 276 273 277 … … 286 290 mEventQService = do_GetService(kEventQueueServiceCID); 287 291 288 nsComponentManager::CreateInstance(aClass, 292 nsComponentManager::CreateInstance(aClass, 289 293 aDelegate, 290 294 aIID, … … 296 300 297 301 nsProxyObject::~nsProxyObject() 298 { 299 // I am worried about order of destruction here. 302 { 303 // I am worried about order of destruction here. 300 304 // do not remove assignments. 301 305 302 306 mRealObject = 0; 303 307 mDestQueue = 0; … … 315 319 nsProxyObject::Release(void) 316 320 { 317 NS_PRECONDITION(0 != mRefCnt, "dup release"); 321 NS_PRECONDITION(0 != mRefCnt, "dup release"); 318 322 319 323 nsrefcnt count = PR_AtomicDecrement((PRInt32 *)&mRefCnt); … … 343 347 return; // if this happens we are going to leak. 344 348 } 345 346 PL_InitEvent(event, 349 350 PL_InitEvent(event, 347 351 this, 348 352 ProxyDestructorEventHandler, 349 ProxyDestructorDestroyHandler); 353 ProxyDestructorDestroyHandler); 350 354 351 355 mDestQueue->PostEvent(event); 352 } 353 } 356 } 357 } 354 358 355 359 … … 357 361 nsProxyObject::PostAndWait(nsProxyObjectCallInfo *proxyInfo) 358 362 { 359 if (proxyInfo == nsnull || mEventQService == nsnull) 363 if (proxyInfo == nsnull || mEventQService == nsnull) 360 364 return NS_ERROR_NULL_POINTER; 361 365 362 366 PRBool eventLoopCreated = PR_FALSE; 363 nsresult rv; 367 nsresult rv; 364 368 365 369 nsCOMPtr<nsIEventQueue> eventQ; … … 371 375 if (NS_FAILED(rv)) 372 376 return rv; 373 377 374 378 rv = mEventQService->GetThreadEventQueue(NS_CURRENT_THREAD, getter_AddRefs(eventQ)); 375 379 } … … 377 381 if (NS_FAILED(rv)) 378 382 return rv; 379 383 380 384 proxyInfo->SetCallersQueue(eventQ); 381 385 … … 383 387 if (!event) 384 388 return NS_ERROR_NULL_POINTER; 385 389 386 390 mDestQueue->PostEvent(event); 387 391 … … 391 395 rv = eventQ->WaitForEvent(&nextEvent); 392 396 if (NS_FAILED(rv)) break; 393 397 394 398 eventQ->HandleEvent(nextEvent); 395 } 399 } 396 400 397 401 if (eventLoopCreated) … … 400 404 eventQ = 0; 401 405 } 402 406 403 407 return rv; 404 408 } 405 406 409 410 407 411 nsresult 408 nsProxyObject::convertMiniVariantToVariant(nsXPTMethodInfo *methodInfo, 409 nsXPTCMiniVariant * params, 410 nsXPTCVariant **fullParam, 412 nsProxyObject::convertMiniVariantToVariant(nsXPTMethodInfo *methodInfo, 413 nsXPTCMiniVariant * params, 414 nsXPTCVariant **fullParam, 411 415 uint8 *outParamCount) 412 416 { … … 416 420 417 421 if (!paramCount) return NS_OK; 418 422 423 #ifdef VBOX_USE_IPRT_IN_XPCOM 424 *fullParam = (nsXPTCVariant*)nsMemory::Alloc(sizeof(nsXPTCVariant) * paramCount); 425 #else 419 426 *fullParam = (nsXPTCVariant*)malloc(sizeof(nsXPTCVariant) * paramCount); 420 427 #endif 428 421 429 if (*fullParam == nsnull) 422 430 return NS_ERROR_OUT_OF_MEMORY; 423 431 424 432 for (int i = 0; i < paramCount; i++) 425 433 { … … 427 435 if ((mProxyType & PROXY_ASYNC) && paramInfo.IsDipper()) 428 436 { 429 NS_WARNING("Async proxying of out parameters is not supported"); 437 NS_WARNING("Async proxying of out parameters is not supported"); 430 438 return NS_ERROR_PROXY_INVALID_OUT_PARAMETER; 431 439 } … … 433 441 (*fullParam)[i].Init(params[i], paramInfo.GetType(), flags); 434 442 } 435 443 436 444 return NS_OK; 437 445 } 438 446 439 447 nsresult 440 nsProxyObject::Post( PRUint32 methodIndex, 441 nsXPTMethodInfo *methodInfo, 442 nsXPTCMiniVariant * params, 443 nsIInterfaceInfo *interfaceInfo) 444 { 445 nsresult rv = NS_OK; 448 nsProxyObject::Post( PRUint32 methodIndex, 449 nsXPTMethodInfo *methodInfo, 450 nsXPTCMiniVariant * params, 451 nsIInterfaceInfo *interfaceInfo) 452 { 453 nsresult rv = NS_OK; 446 454 447 455 if (! mDestQueue || ! mRealObject) … … 450 458 if (methodInfo->IsNotXPCOM()) 451 459 return NS_ERROR_PROXY_INVALID_IN_PARAMETER; 452 460 453 461 nsXPTCVariant *fullParam; 454 uint8 paramCount; 462 uint8 paramCount; 455 463 rv = convertMiniVariantToVariant(methodInfo, params, &fullParam, ¶mCount); 456 464 457 465 if (NS_FAILED(rv)) 458 466 return rv; … … 462 470 // see if we should call into the method directly. Either it is a QI function call 463 471 // (methodIndex == 0), or it is a sync proxy and this code is running on the same thread 464 // as the destination event queue. 472 // as the destination event queue. 465 473 if ( (methodIndex == 0) || 466 (mProxyType & PROXY_SYNC && 474 (mProxyType & PROXY_SYNC && 467 475 NS_SUCCEEDED(mDestQueue->IsOnCurrentThread(&callDirectly)) && 468 476 callDirectly)) … … 470 478 471 479 // invoke the magic of xptc... 472 nsresult rv = XPTC_InvokeByIndex( mRealObject, 480 nsresult rv = XPTC_InvokeByIndex( mRealObject, 473 481 methodIndex, 474 paramCount, 482 paramCount, 475 483 fullParam); 476 477 if (fullParam) 484 485 if (fullParam) 486 #ifdef VBOX_USE_IPRT_IN_XPCOM 487 nsMemory::Free(fullParam); 488 #else 478 489 free(fullParam); 490 #endif 479 491 return rv; 480 492 } 481 493 482 494 PLEvent *event = PR_NEW(PLEvent); 483 495 484 496 if (event == nsnull) { 485 if (fullParam) 497 if (fullParam) 498 #ifdef VBOX_USE_IPRT_IN_XPCOM 499 nsMemory::Free(fullParam); 500 #else 486 501 free(fullParam); 487 return NS_ERROR_OUT_OF_MEMORY; 488 } 489 490 nsProxyObjectCallInfo *proxyInfo = new nsProxyObjectCallInfo(this, 491 methodInfo, 492 methodIndex, 502 #endif 503 return NS_ERROR_OUT_OF_MEMORY; 504 } 505 506 nsProxyObjectCallInfo *proxyInfo = new nsProxyObjectCallInfo(this, 507 methodInfo, 508 methodIndex, 493 509 fullParam, // will be deleted by ~() 494 paramCount, 510 paramCount, 495 511 event); // will be deleted by ~() 496 512 497 513 if (proxyInfo == nsnull) { 498 514 PR_DELETE(event); 499 515 if (fullParam) 516 #ifdef VBOX_USE_IPRT_IN_XPCOM 517 nsMemory::Free(fullParam); 518 #else 500 519 free(fullParam); 501 return NS_ERROR_OUT_OF_MEMORY; 502 } 503 504 PL_InitEvent(event, 520 #endif 521 return NS_ERROR_OUT_OF_MEMORY; 522 } 523 524 PL_InitEvent(event, 505 525 proxyInfo, 506 526 EventHandler, 507 527 DestroyHandler); 508 528 509 529 if (mProxyType & PROXY_SYNC) 510 530 { 511 531 rv = PostAndWait(proxyInfo); 512 532 513 533 if (NS_SUCCEEDED(rv)) 514 534 rv = proxyInfo->GetResult(); … … 516 536 return rv; 517 537 } 518 538 519 539 if (mProxyType & PROXY_ASYNC) 520 540 { … … 527 547 528 548 529 static void DestroyHandler(PLEvent *self) 549 static void DestroyHandler(PLEvent *self) 530 550 { 531 551 nsProxyObjectCallInfo* owner = (nsProxyObjectCallInfo*)PL_GetEventOwner(self); 532 552 nsProxyObject* proxyObject = owner->GetProxyObject(); 533 553 534 554 if (proxyObject == nsnull) 535 555 return; 536 556 537 557 if (proxyObject->GetProxyType() & PROXY_ASYNC) 538 { 558 { 539 559 delete owner; 540 560 } … … 546 566 } 547 567 548 static void* EventHandler(PLEvent *self) 568 static void* EventHandler(PLEvent *self) 549 569 { 550 570 nsProxyObjectCallInfo *info = (nsProxyObjectCallInfo*)PL_GetEventOwner(self); 551 571 NS_ASSERTION(info, "No nsProxyObjectCallInfo!"); 552 572 553 573 nsProxyObject *proxyObject = info->GetProxyObject(); 554 574 555 575 if (proxyObject) 556 576 { 557 577 // invoke the magic of xptc... 558 nsresult rv = XPTC_InvokeByIndex( proxyObject->GetRealObject(), 578 nsresult rv = XPTC_InvokeByIndex( proxyObject->GetRealObject(), 559 579 info->GetMethodIndex(), 560 info->GetParameterCount(), 580 info->GetParameterCount(), 561 581 info->GetParameterList()); 562 582 info->SetResult(rv); … … 569 589 } 570 590 571 static void CompletedDestroyHandler(PLEvent *self) 572 { 573 } 574 575 static void* CompletedEventHandler(PLEvent *self) 591 static void CompletedDestroyHandler(PLEvent *self) 592 { 593 } 594 595 static void* CompletedEventHandler(PLEvent *self) 576 596 { 577 597 nsProxyObjectCallInfo* owner = (nsProxyObjectCallInfo*)PL_GetEventOwner(self); … … 581 601 582 602 static void* ProxyDestructorEventHandler(PLEvent *self) 583 { 603 { 584 604 nsProxyObject* owner = (nsProxyObject*) PL_GetEventOwner(self); 585 605 NS_DELETEXPCOM(owner); 586 return nsnull; 606 return nsnull; 587 607 } 588 608 -
trunk/src/libs/xpcom18a4/xpcom/string/src/nsStringObsolete.cpp
r1 r31259 53 53 #include "prdtoa.h" 54 54 #include "prprf.h" 55 #ifdef VBOX_USE_IPRT_IN_XPCOM 56 # include <iprt/mem.h> 57 #endif 55 58 56 59 /* ***** BEGIN RICKG BLOCK ***** … … 79 82 /** 80 83 * This methods cans the given buffer for the given char 81 * 84 * 82 85 * @update gess 02/17/00 83 86 * @param aDest is the buffer to be searched … … 101 104 //We'll only search if the given aChar is within the normal ascii a range, 102 105 //(Since this string is definitely within the ascii range). 103 106 104 107 if(0<aCount) { 105 108 … … 111 114 PRInt32 theMax = end-left; 112 115 if(0<theMax) { 113 116 114 117 unsigned char theChar = (unsigned char) aChar; 115 118 const char* result=(const char*)memchr(left, (int)theChar, theMax); 116 119 117 120 if(result) 118 121 return result-aDest; 119 122 120 123 } 121 124 } … … 128 131 /** 129 132 * This methods cans the given buffer for the given char 130 * 133 * 131 134 * @update gess 3/25/98 132 135 * @param aDest is the buffer to be searched … … 147 150 148 151 if((0<aDestLength) && ((PRUint32)anOffset < aDestLength)) { 149 152 150 153 if(0<aCount) { 151 154 … … 157 160 158 161 while(left<end){ 159 162 160 163 if(*left==aChar) 161 164 return (left-root); 162 165 163 166 ++left; 164 167 } … … 172 175 /** 173 176 * This methods cans the given buffer (in reverse) for the given char 174 * 177 * 175 178 * @update gess 02/17/00 176 179 * @param aDest is the buffer to be searched … … 195 198 //We'll only search if the given aChar is within the normal ascii a range, 196 199 //(Since this string is definitely within the ascii range). 197 200 198 201 if(0 < aCount) { 199 202 200 const char* rightmost = aDest + anOffset; 203 const char* rightmost = aDest + anOffset; 201 204 const char* min = rightmost - aCount + 1; 202 205 const char* leftmost = (min<aDest) ? aDest: min; … … 204 207 char theChar=(char)aChar; 205 208 while(leftmost <= rightmost){ 206 209 207 210 if((*rightmost) == theChar) 208 211 return rightmost - aDest; 209 212 210 213 --rightmost; 211 214 } … … 219 222 /** 220 223 * This methods cans the given buffer for the given char 221 * 224 * 222 225 * @update gess 3/25/98 223 226 * @param aDest is the buffer to be searched … … 238 241 239 242 if((0 < aDestLength) && ((PRUint32)anOffset < aDestLength)) { 240 243 241 244 if(0 < aCount) { 242 245 243 246 const PRUnichar* root = aDest; 244 const PRUnichar* rightmost = root + anOffset; 247 const PRUnichar* rightmost = root + anOffset; 245 248 const PRUnichar* min = rightmost - aCount + 1; 246 249 const PRUnichar* leftmost = (min<root) ? root: min; 247 250 248 251 while(leftmost <= rightmost){ 249 252 250 253 if((*rightmost) == aChar) 251 254 return rightmost - root; 252 255 253 256 --rightmost; 254 257 } … … 283 286 #endif /* __SUNPRO_CC */ 284 287 PRInt32 285 Compare1To1(const char* aStr1,const char* aStr2,PRUint32 aCount,PRBool aIgnoreCase){ 288 Compare1To1(const char* aStr1,const char* aStr2,PRUint32 aCount,PRBool aIgnoreCase){ 286 289 PRInt32 result=0; 287 290 if(aIgnoreCase) 288 291 result=PRInt32(PL_strncasecmp(aStr1, aStr2, aCount)); 289 else 292 else 290 293 result=nsCharTraits<char>::compare(aStr1,aStr2,aCount); 291 294 … … 308 311 * @return -1,0,1 depending on <,==,> 309 312 */ 310 static 313 static 311 314 #ifdef __SUNPRO_CC 312 315 inline … … 315 318 Compare2To2(const PRUnichar* aStr1,const PRUnichar* aStr2,PRUint32 aCount){ 316 319 PRInt32 result; 317 320 318 321 if ( aStr1 && aStr2 ) 319 322 result = nsCharTraits<PRUnichar>::compare(aStr1, aStr2, aCount); … … 356 359 const PRUnichar* s1 = aStr1; 357 360 const char *s2 = aStr2; 358 361 359 362 if (aStr1 && aStr2) { 360 363 if (aCount != 0) { … … 363 366 PRUnichar c1 = *s1++; 364 367 PRUnichar c2 = PRUnichar((unsigned char)*s2++); 365 368 366 369 if (c1 != c2) { 367 370 #ifdef NS_DEBUG … … 379 382 c1 = ascii_tolower(char(c1)); 380 383 c2 = ascii_tolower(char(c2)); 381 384 382 385 if (c1 == c2) continue; 383 386 } … … 415 418 416 419 /** 417 * This method compresses duplicate runs of a given char from the given buffer 420 * This method compresses duplicate runs of a given char from the given buffer 418 421 * 419 422 * @update rickg 03.23.2000 … … 426 429 */ 427 430 static PRInt32 428 CompressChars1(char* aString,PRUint32 aLength,const char* aSet){ 431 CompressChars1(char* aString,PRUint32 aLength,const char* aSet){ 429 432 430 433 char* from = aString; … … 439 442 while (from < end) { 440 443 char theChar = *from++; 441 444 442 445 *to++=theChar; //always copy this char... 443 446 … … 460 463 461 464 /** 462 * This method compresses duplicate runs of a given char from the given buffer 465 * This method compresses duplicate runs of a given char from the given buffer 463 466 * 464 467 * @update rickg 03.23.2000 … … 471 474 */ 472 475 static PRInt32 473 CompressChars2(PRUnichar* aString,PRUint32 aLength,const char* aSet){ 476 CompressChars2(PRUnichar* aString,PRUint32 aLength,const char* aSet){ 474 477 475 478 PRUnichar* from = aString; … … 484 487 while (from < end) { 485 488 PRUnichar theChar = *from++; 486 489 487 490 *to++=theChar; //always copy this char... 488 491 … … 503 506 504 507 /** 505 * This method strips chars in a given set from the given buffer 508 * This method strips chars in a given set from the given buffer 506 509 * 507 510 * @update gess 01/04/99 … … 514 517 */ 515 518 static PRInt32 516 StripChars1(char* aString,PRUint32 aLength,const char* aSet){ 519 StripChars1(char* aString,PRUint32 aLength,const char* aSet){ 517 520 518 521 // XXXdarin this code should defer writing until necessary. … … 537 540 538 541 /** 539 * This method strips chars in a given set from the given buffer 542 * This method strips chars in a given set from the given buffer 540 543 * 541 544 * @update gess 01/04/99 … … 548 551 */ 549 552 static PRInt32 550 StripChars2(PRUnichar* aString,PRUint32 aLength,const char* aSet){ 553 StripChars2(PRUnichar* aString,PRUint32 aLength,const char* aSet){ 551 554 552 555 // XXXdarin this code should defer writing until necessary. … … 560 563 while (++from < end) { 561 564 PRUnichar theChar = *from; 562 //Note the test for ascii range below. If you have a real unicode char, 565 //Note the test for ascii range below. If you have a real unicode char, 563 566 //and you're searching for chars in the (given) ascii string, there's no 564 567 //point in doing the real search since it's out of the ascii range. … … 635 638 636 639 static 637 PRInt32 compress_chars( char* s, PRUint32 len, const char* set ) 640 PRInt32 compress_chars( char* s, PRUint32 len, const char* set ) 638 641 { 639 642 return CompressChars1(s, len, set); … … 688 691 689 692 static 690 PRInt32 compress_chars( PRUnichar* s, PRUint32 len, const char* set ) 693 PRInt32 compress_chars( PRUnichar* s, PRUint32 len, const char* set ) 691 694 { 692 695 return CompressChars2(s, len, set); … … 751 754 CharT filter = nsBufferRoutines<CharT>::get_find_in_set_filter(set); 752 755 753 const CharT* end = data + dataLen; 756 const CharT* end = data + dataLen; 754 757 for (const CharT* iter = data; iter < end; ++iter) 755 758 { … … 807 810 * XXXdarin if this is the right thing, then why wasn't it fixed in NSPR?!? 808 811 */ 809 void 812 void 810 813 Modified_cnvtf(char *buf, int bufsz, int prcsn, double fval) 811 814 { … … 816 819 817 820 /* If anything fails, we store an empty string in 'buf' */ 821 #ifdef VBOX_USE_IPRT_IN_XPCOM 822 num = (char*)RTMemAlloc(bufsz); 823 #else 818 824 num = (char*)malloc(bufsz); 825 #endif 819 826 if (num == NULL) { 820 827 buf[0] = '\0'; … … 891 898 } 892 899 done: 900 #ifdef VBOX_USE_IPRT_IN_XPCOM 901 RTMemFree(num); 902 #else 893 903 free(num); 904 #endif 894 905 } 895 906 896 907 /** 897 908 * this method changes the meaning of |offset| and |count|: 898 * 909 * 899 910 * upon return, 900 911 * |offset| specifies start of search range 901 912 * |count| specifies length of search range 902 */ 913 */ 903 914 static void 904 915 Find_ComputeSearchRange( PRUint32 bigLen, PRUint32 littleLen, PRInt32& offset, PRInt32& count ) … … 920 931 { 921 932 count = maxCount; 922 } 933 } 923 934 else 924 935 { … … 935 946 * |offset| specifies the end point from which to search backwards 936 947 * |count| specifies the number of iterations from |offset| 937 * 948 * 938 949 * upon return, 939 950 * |offset| specifies start of search range … … 942 953 * 943 954 * EXAMPLE 944 * 955 * 945 956 * + -- littleLen=4 -- + 946 957 * : : … … 952 963 * count = 7. 953 964 * 954 */ 965 */ 955 966 static void 956 967 RFind_ComputeSearchRange( PRUint32 bigLen, PRUint32 littleLen, PRInt32& offset, PRInt32& count ) … … 1035 1046 else if (aOffset >= PRInt32(mLength)) 1036 1047 return kNotFound; 1037 1048 1038 1049 PRInt32 result = ::FindCharInSet(mData + aOffset, mLength - aOffset, aSet); 1039 1050 if (result != kNotFound) -
trunk/src/libs/xpcom18a4/xpcom/string/src/nsSubstring.cpp
r1 r31259 51 51 #include "nsMemory.h" 52 52 #include "pratom.h" 53 #ifdef VBOX_USE_IPRT_IN_XPCOM 54 # include <iprt/mem.h> 55 #endif 53 56 54 57 // --------------------------------------------------------------------------- … … 76 79 return; 77 80 81 #ifndef VBOX 78 82 printf("nsStringStats\n"); 79 83 printf(" => mAllocCount: % 10d\n", mAllocCount); … … 91 95 else 92 96 printf("\n"); 97 #endif 93 98 } 94 99 … … 137 142 { 138 143 STRING_STAT_INCREMENT(Free); 144 #ifdef VBOX_USE_IPRT_IN_XPCOM 145 RTMemFree(this); // we were allocated with |malloc| 146 #else 139 147 free(this); // we were allocated with |malloc| 148 #endif 140 149 } 141 150 } … … 147 156 { 148 157 STRING_STAT_INCREMENT(Alloc); 149 158 150 159 NS_ASSERTION(size != 0, "zero capacity allocation not allowed"); 151 160 152 161 nsStringHeader *hdr = 162 #ifdef VBOX_USE_IPRT_IN_XPCOM 163 (nsStringHeader *) RTMemAlloc(sizeof(nsStringHeader) + size); 164 #else 153 165 (nsStringHeader *) malloc(sizeof(nsStringHeader) + size); 166 #endif 154 167 if (hdr) 155 168 { … … 169 182 NS_ASSERTION(!hdr->IsReadonly(), "|Realloc| attempted on readonly string"); 170 183 184 #ifdef VBOX_USE_IPRT_IN_XPCOM 185 hdr = (nsStringHeader*) RTMemRealloc(hdr, sizeof(nsStringHeader) + size); 186 #else 171 187 hdr = (nsStringHeader*) realloc(hdr, sizeof(nsStringHeader) + size); 188 #endif 172 189 if (hdr) 173 190 hdr->mStorageSize = size; -
trunk/src/libs/xpcom18a4/xpcom/threads/nsProcessCommon.cpp
r1 r31259 39 39 40 40 /***************************************************************************** 41 * 41 * 42 42 * nsProcess is used to execute new processes and specify if you want to 43 43 * wait (blocking) or continue (non-blocking). … … 89 89 mExecutable = executable; 90 90 //Get the path because it is needed by the NSPR process creation 91 #ifdef XP_WIN 91 #ifdef XP_WIN 92 92 rv = mExecutable->GetNativeTarget(mTargetPath); 93 93 if (NS_FAILED(rv) || mTargetPath.IsEmpty() ) … … 133 133 /* Add a space to separates the arguments */ 134 134 if (arg != argv) { 135 *p++ = ' '; 135 *p++ = ' '; 136 136 } 137 137 q = *arg; … … 196 196 *p++ = '"'; 197 197 } 198 } 198 } 199 199 200 200 *p = '\0'; … … 204 204 205 205 // XXXldb |args| has the wrong const-ness 206 NS_IMETHODIMP 206 NS_IMETHODIMP 207 207 nsProcess::Run(PRBool blocking, const char **args, PRUint32 count, PRUint32 *pid) 208 208 { … … 213 213 // pass into PR_CreateProcess 214 214 char **my_argv = NULL; 215 #ifdef VBOX 216 my_argv = (char **)nsMemory::Alloc(sizeof(char *) * (count + 2) ); 217 #else 215 218 my_argv = (char **)malloc(sizeof(char *) * (count + 2) ); 219 #endif 216 220 if (!my_argv) { 217 221 return NS_ERROR_OUT_OF_MEMORY; … … 236 240 if (assembleCmdLine(my_argv, &cmdLine) == -1) { 237 241 nsMemory::Free(my_argv); 238 return NS_ERROR_FILE_EXECUTION_FAILED; 242 return NS_ERROR_FILE_EXECUTION_FAILED; 239 243 } 240 244 … … 258 262 PR_FREEIF( cmdLine ); 259 263 if (blocking) { 260 264 261 265 // if success, wait for process termination. the early returns and such 262 // are a bit ugly but preserving the logic of the nspr code I copied to 266 // are a bit ugly but preserving the logic of the nspr code I copied to 263 267 // minimize our risk abit. 264 268 … … 282 286 else 283 287 rv = PR_FAILURE; 284 } 288 } 285 289 else { 286 290 287 291 // map return value into success code 288 292 289 if ( retVal == TRUE ) 293 if ( retVal == TRUE ) 290 294 rv = PR_SUCCESS; 291 295 else … … 347 351 if (mProcess) 348 352 rv = PR_KillProcess(mProcess); 349 353 350 354 return rv; 351 355 } … … 355 359 { 356 360 *aExitValue = mExitValue; 357 361 358 362 return NS_OK; 359 363 } -
trunk/src/libs/xpcom18a4/xpcom/typelib/xpt/src/xpt_arena.c
r1 r31259 40 40 /* XXX This exists because we don't want to drag in NSPR. It *seemed* 41 41 * to make more sense to write a quick and dirty arena than to clone 42 * plarena (like js/src did). This is not optimal, but it works. 42 * plarena (like js/src did). This is not optimal, but it works. 43 43 * Half of the code here is instrumentation. 44 44 */ … … 48 48 #include <stdio.h> 49 49 #include <stdlib.h> 50 #ifdef VBOX_USE_IPRT_IN_XPCOM 51 # include <iprt/mem.h> 52 #endif 53 50 54 51 55 /*************************/ … … 94 98 #define LOG_FREE(_a) ((void)0) 95 99 96 #define LOG_DONE_LOADING(_a) ((void)0) 100 #define LOG_DONE_LOADING(_a) ((void)0) 97 101 #define PRINT_STATS(_a) ((void)0) 98 102 … … 137 141 XPT_NewArena(PRUint32 block_size, size_t alignment, const char* name) 138 142 { 143 #ifdef VBOX_USE_IPRT_IN_XPCOM 144 XPTArena *arena = RTMemAllocZ(sizeof(XPTArena)); 145 #else 139 146 XPTArena *arena = calloc(1, sizeof(XPTArena)); 147 #endif 140 148 if (arena) { 141 149 XPT_ASSERT(alignment); … … 149 157 150 158 /* must have room for at least one item! */ 151 XPT_ASSERT(arena->block_size >= 159 XPT_ASSERT(arena->block_size >= 152 160 ALIGN_RND(sizeof(BLK_HDR), alignment) + 153 161 ALIGN_RND(1, alignment)); 154 162 155 163 if (name) { 156 arena->name = XPT_STRDUP(arena, name); 164 arena->name = XPT_STRDUP(arena, name); 157 165 #ifdef XPT_ARENA_LOGGING 158 166 /* fudge the stats since we are using space in the arena */ … … 163 171 } 164 172 } 165 return arena; 173 return arena; 166 174 } 167 175 … … 171 179 BLK_HDR* cur; 172 180 BLK_HDR* next; 173 181 174 182 cur = arena->first; 175 183 while (cur) { 176 184 next = cur->next; 185 #ifdef VBOX_USE_IPRT_IN_XPCOM 186 RTMemFree(cur); 187 #else 177 188 free(cur); 189 #endif 178 190 cur = next; 179 191 } 192 #ifdef VBOX_USE_IPRT_IN_XPCOM 193 RTMemFree(arena); 194 #else 180 195 free(arena); 196 #endif 181 197 } 182 198 … … 185 201 { 186 202 PRINT_STATS(arena); 187 } 188 189 190 /* 191 * Our alignment rule is that we always round up the size of each allocation 203 } 204 205 206 /* 207 * Our alignment rule is that we always round up the size of each allocation 192 208 * so that the 'arena->next' pointer one will point to properly aligned space. 193 209 */ … … 208 224 209 225 bytes = ALIGN_RND(size, arena->alignment); 210 226 211 227 LOG_MALLOC(arena, size, bytes); 212 228 … … 215 231 size_t block_header_size = ALIGN_RND(sizeof(BLK_HDR), arena->alignment); 216 232 size_t new_space = arena->block_size; 217 233 218 234 if (bytes > new_space - block_header_size) 219 235 new_space += bytes; 220 236 221 new_block = (BLK_HDR*) calloc(new_space/arena->alignment, 237 #ifdef VBOX_USE_IPRT_IN_XPCOM 238 new_block = (BLK_HDR*) RTMemAllocZ(new_space/arena->alignment * (size_t)arena->alignment); 239 #else 240 new_block = (BLK_HDR*) calloc(new_space/arena->alignment, 222 241 arena->alignment); 242 #endif 223 243 if (!new_block) { 224 244 arena->next = NULL; … … 244 264 memset(arena->next, 0xcd, arena->space); 245 265 #endif 246 } 247 266 } 267 248 268 #ifdef DEBUG 249 269 { … … 251 271 size_t i; 252 272 for (i = 0; i < bytes; ++i) { 253 XPT_ASSERT(arena->next[i] == 0xcd); 273 XPT_ASSERT(arena->next[i] == 0xcd); 254 274 } 255 275 /* we guarantee that the block will be filled with zeros */ 256 276 memset(arena->next, 0, bytes); 257 } 277 } 258 278 #endif 259 279 … … 261 281 arena->next += bytes; 262 282 arena->space -= bytes; 263 264 return cur; 283 284 return cur; 265 285 } 266 286 … … 286 306 #ifdef XPT_ARENA_LOGGING 287 307 if (arena) { 288 LOG_DONE_LOADING(arena); 308 LOG_DONE_LOADING(arena); 289 309 } 290 310 #endif … … 301 321 { 302 322 printf("()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()\n"); 303 printf("Start xpt arena stats for \"%s\"\n", 323 printf("Start xpt arena stats for \"%s\"\n", 304 324 arena->name ? arena->name : "unnamed arena"); 305 325 printf("\n"); 306 printf("%d times arena malloc called\n", (int) arena->LOG_MallocCallCount); 307 printf("%d total bytes requested from arena malloc\n", (int) arena->LOG_MallocTotalBytesRequested); 326 printf("%d times arena malloc called\n", (int) arena->LOG_MallocCallCount); 327 printf("%d total bytes requested from arena malloc\n", (int) arena->LOG_MallocTotalBytesRequested); 308 328 printf("%d average bytes requested per call to arena malloc\n", (int)arena->LOG_MallocCallCount ? (arena->LOG_MallocTotalBytesRequested/arena->LOG_MallocCallCount) : 0); 309 329 printf("%d average bytes used per call (accounts for alignment overhead)\n", (int)arena->LOG_MallocCallCount ? (arena->LOG_MallocTotalBytesUsed/arena->LOG_MallocCallCount) : 0); 310 330 printf("%d average bytes used per call (accounts for all overhead and waste)\n", (int)arena->LOG_MallocCallCount ? (arena->LOG_RealMallocTotalBytesRequested/arena->LOG_MallocCallCount) : 0); 311 331 printf("\n"); 312 printf("%d during loading times arena free called\n", (int) arena->LOG_LoadingFreeCallCount); 313 printf("%d during loading approx total bytes not freed\n", (int) arena->LOG_LoadingFreeCallCount * (int) (arena->LOG_MallocCallCount ? (arena->LOG_MallocTotalBytesUsed/arena->LOG_MallocCallCount) : 0)); 314 printf("\n"); 315 printf("%d total times arena free called\n", (int) arena->LOG_FreeCallCount); 316 printf("%d approx total bytes not freed until arena destruction\n", (int) arena->LOG_FreeCallCount * (int) (arena->LOG_MallocCallCount ? (arena->LOG_MallocTotalBytesUsed/arena->LOG_MallocCallCount) : 0 )); 317 printf("\n"); 318 printf("%d times arena called system malloc\n", (int) arena->LOG_RealMallocCallCount); 319 printf("%d total bytes arena requested from system\n", (int) arena->LOG_RealMallocTotalBytesRequested); 320 printf("%d byte block size specified at arena creation time\n", (int) arena->block_size); 321 printf("%d byte block alignment specified at arena creation time\n", (int) arena->alignment); 332 printf("%d during loading times arena free called\n", (int) arena->LOG_LoadingFreeCallCount); 333 printf("%d during loading approx total bytes not freed\n", (int) arena->LOG_LoadingFreeCallCount * (int) (arena->LOG_MallocCallCount ? (arena->LOG_MallocTotalBytesUsed/arena->LOG_MallocCallCount) : 0)); 334 printf("\n"); 335 printf("%d total times arena free called\n", (int) arena->LOG_FreeCallCount); 336 printf("%d approx total bytes not freed until arena destruction\n", (int) arena->LOG_FreeCallCount * (int) (arena->LOG_MallocCallCount ? (arena->LOG_MallocTotalBytesUsed/arena->LOG_MallocCallCount) : 0 )); 337 printf("\n"); 338 printf("%d times arena called system malloc\n", (int) arena->LOG_RealMallocCallCount); 339 printf("%d total bytes arena requested from system\n", (int) arena->LOG_RealMallocTotalBytesRequested); 340 printf("%d byte block size specified at arena creation time\n", (int) arena->block_size); 341 printf("%d byte block alignment specified at arena creation time\n", (int) arena->alignment); 322 342 printf("\n"); 323 343 printf("End xpt arena stats\n"); 324 344 printf("()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()\n"); 325 } 345 } 326 346 #endif 327 347 … … 335 355 s, file, lineno); 336 356 abort(); 337 } 338 #endif 357 } 358 #endif
Note:
See TracChangeset
for help on using the changeset viewer.