Changeset 31259 in vbox for trunk/src/libs
- Timestamp:
- Jul 30, 2010 8:02:05 PM (14 years ago)
- Location:
- trunk/src/libs/xpcom18a4
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/xpcom18a4/Config.kmk
r29232 r31259 59 59 TEMPLATE_XPCOM_CFLAGS.linux = -pthread -ansi 60 60 TEMPLATE_XPCOM_CFLAGS.solaris = -fno-omit-frame-pointer # for now anyway. 61 TEMPLATE_XPCOM_DEFS = MOZILLA_CLIENT=1 NDEBUG=1 _IMPL_NS_COM \ 62 XPCOM_DLL_BASE=\"$(basename $(notdir $(LIB_XPCOM)))\" \ 63 MOZ_DLL_SUFFIX=\"$(suffix $(LIB_XPCOM))\" \ 64 IN_RING3 61 TEMPLATE_XPCOM_DEFS = \ 62 MOZILLA_CLIENT=1 \ 63 NDEBUG=1 \ 64 _IMPL_NS_COM \ 65 XPCOM_DLL_BASE=\"$(basename $(notdir $(LIB_XPCOM)))\" \ 66 MOZ_DLL_SUFFIX=\"$(suffix $(LIB_XPCOM))\" \ 67 IN_RING3 \ 68 VBOX_USE_IPRT_IN_XPCOM 65 69 ifdef VBOX_WITH_XPCOM_NAMESPACE_CLEANUP 66 70 TEMPLATE_XPCOM_DEFS += VBOX_WITH_XPCOM_NAMESPACE_CLEANUP … … 191 195 TEMPLATE_XPCOMBLDPROG_EXTENDS = VBOXBLDPROG 192 196 ## @todo Verify that this doesn't blow up because of template inheriance ordering. (we're assuming XPCOMEXE is expanded when this is being used.) 193 TEMPLATE_XPCOMBLDPROG_DEFS = $(TEMPLATE_VBOXBLDPROG_DEFS) $(TEMPLATE_XPCOMEXE_DEFS) 197 TEMPLATE_XPCOMBLDPROG_DEFS = \ 198 $(TEMPLATE_VBOXBLDPROG_DEFS) \ 199 $(filter-out VBOX_USE_IPRT_IN_XPCOM, $(TEMPLATE_XPCOMEXE_DEFS)) 194 200 TEMPLATE_XPCOMBLDPROG_DEFS.$(KBUILD_HOST) = $(TEMPLATE_VBOXBLDPROG_DEFS.$(KBUILD_HOST)) $(TEMPLATE_XPCOMEXE_DEFS.$(KBUILD_HOST)) 195 201 TEMPLATE_XPCOMBLDPROG_DEFS.x86 = $(TEMPLATE_VBOXBLDPROG_DEFS.x86) $(TEMPLATE_XPCOMEXE_DEFS.x86) -
trunk/src/libs/xpcom18a4/ipc/ipcd/extensions/transmngr/common/tmTransaction.cpp
r1 r31259 38 38 #include <stdlib.h> 39 39 #include "tmTransaction.h" 40 #ifdef VBOX_USE_IPRT_IN_XPCOM 41 # include <iprt/mem.h> 42 #endif 40 43 41 44 /////////////////////////////////////////////////////////////////////////////// … … 44 47 tmTransaction::~tmTransaction() { 45 48 if (mHeader) 49 #ifdef VBOX_USE_IPRT_IN_XPCOM 50 RTMemFree(mHeader); 51 #else 46 52 free(mHeader); 53 #endif 47 54 } 48 55 … … 51 58 nsresult 52 59 tmTransaction::Init(PRUint32 aOwnerID, 53 PRInt32 aQueueID, 54 PRUint32 aAction, 55 PRInt32 aStatus, 56 const PRUint8 *aMessage, 60 PRInt32 aQueueID, 61 PRUint32 aAction, 62 PRInt32 aStatus, 63 const PRUint8 *aMessage, 57 64 PRUint32 aLength) { 58 65 nsresult rv = NS_OK; … … 61 68 // indicates the message is the entire raw message 62 69 if (aQueueID == TM_INVALID_ID) { 70 #ifdef VBOX_USE_IPRT_IN_XPCOM 71 header = (tmHeader*) RTMemAlloc(aLength); 72 #else 63 73 header = (tmHeader*) malloc(aLength); 74 #endif 64 75 if (header) { 65 76 mRawMessageLength = aLength; … … 70 81 } 71 82 else { // need to create the tmHeader and concat the message 83 #ifdef VBOX_USE_IPRT_IN_XPCOM 84 header = (tmHeader*) RTMemAlloc (sizeof(tmHeader) + aLength); 85 #else 72 86 header = (tmHeader*) malloc (sizeof(tmHeader) + aLength); 87 #endif 73 88 if (header) { 74 89 mRawMessageLength = sizeof(tmHeader) + aLength; -
trunk/src/libs/xpcom18a4/ipc/ipcd/extensions/transmngr/common/tmVector.cpp
r1 r31259 38 38 #include <stdlib.h> 39 39 #include "tmVector.h" 40 #ifdef VBOX_USE_IPRT_IN_XPCOM 41 # include <iprt/mem.h> 42 #endif 40 43 41 44 //////////////////////////////////////////////////////////////////////////// … … 46 49 tmVector::~tmVector() { 47 50 if (mElements) 51 #ifdef VBOX_USE_IPRT_IN_XPCOM 52 RTMemFree((void*)mElements); 53 #else 48 54 free((void*)mElements); 55 #endif 49 56 } 50 57 … … 55 62 tmVector::Init() { 56 63 64 #ifdef VBOX_USE_IPRT_IN_XPCOM 65 mElements = (void**) RTMemAllocZ (mCapacity * sizeof(void*)); 66 #else 57 67 mElements = (void**) calloc (mCapacity, sizeof(void*)); 68 #endif 58 69 if (!mElements) 59 70 return NS_ERROR_OUT_OF_MEMORY; … … 117 128 //tmVector::operator[](int index) { 118 129 // if (index < mNext && index >= 0) 119 // return mElements[index]; 130 // return mElements[index]; 120 131 // return nsnull; 121 132 //} … … 137 148 138 149 PRUint32 newcap = mCapacity + GROWTH_INC; 150 #ifdef VBOX_USE_IPRT_IN_XPCOM 151 mElements = (void**) RTMemRealloc(mElements, (newcap * sizeof(void*))); 152 #else 139 153 mElements = (void**) realloc(mElements, (newcap * sizeof(void*))); 154 #endif 140 155 if (mElements) { 141 156 mCapacity = newcap; … … 152 167 PRUint32 newcap = mCapacity - GROWTH_INC; 153 168 if (mNext < newcap) { 169 #ifdef VBOX_USE_IPRT_IN_XPCOM 170 mElements = (void**) RTMemRealloc(mElements, newcap * sizeof(void*)); 171 #else 154 172 mElements = (void**) realloc(mElements, newcap * sizeof(void*)); 173 #endif 155 174 if (!mElements) 156 175 return NS_ERROR_OUT_OF_MEMORY; -
trunk/src/libs/xpcom18a4/ipc/ipcd/shared/src/ipcMessage.cpp
r1 r31259 40 40 #include "prlog.h" 41 41 #include "ipcMessage.h" 42 #ifdef VBOX_USE_IPRT_IN_XPCOM 43 # include <iprt/mem.h> 44 #endif 42 45 43 46 ipcMessage::~ipcMessage() 44 47 { 45 48 if (mMsgHdr) 49 #ifdef VBOX_USE_IPRT_IN_XPCOM 50 RTMemFree(mMsgHdr); 51 #else 46 52 free(mMsgHdr); 53 #endif 47 54 } 48 55 … … 51 58 { 52 59 if (mMsgHdr) { 60 #ifdef VBOX_USE_IPRT_IN_XPCOM 61 RTMemFree(mMsgHdr); 62 #else 53 63 free(mMsgHdr); 64 #endif 54 65 mMsgHdr = NULL; 55 66 } … … 68 79 // copy buf if non-null 69 80 if (mMsgHdr) { 81 #ifdef VBOX_USE_IPRT_IN_XPCOM 82 clone->mMsgHdr = (ipcMessageHeader *) RTMemDup(mMsgHdr, mMsgHdr->mLen); 83 #else 70 84 clone->mMsgHdr = (ipcMessageHeader *) malloc(mMsgHdr->mLen); 71 85 memcpy(clone->mMsgHdr, mMsgHdr, mMsgHdr->mLen); 86 #endif 72 87 } 73 88 else … … 84 99 { 85 100 if (mMsgHdr) 101 #ifdef VBOX_USE_IPRT_IN_XPCOM 102 RTMemFree(mMsgHdr); 103 #else 86 104 free(mMsgHdr); 105 #endif 87 106 mMsgComplete = PR_FALSE; 88 107 89 108 // allocate message data 90 109 PRUint32 msgLen = IPC_MSG_HEADER_SIZE + dataLen; 110 #ifdef VBOX_USE_IPRT_IN_XPCOM 111 mMsgHdr = (ipcMessageHeader *) RTMemAlloc(msgLen); 112 #else 91 113 mMsgHdr = (ipcMessageHeader *) malloc(msgLen); 114 #endif 92 115 if (!mMsgHdr) { 93 116 mMsgHdr = NULL; … … 123 146 ipcMessage::Equals(const nsID &target, const char *data, PRUint32 dataLen) const 124 147 { 125 return mMsgComplete && 148 return mMsgComplete && 126 149 mMsgHdr->mTarget.Equals(target) && 127 150 DataLen() == dataLen && … … 199 222 bufLen -= count; 200 223 *bytesRead = count; 201 224 202 225 if (MsgLen() > IPC_MSG_GUESSED_SIZE) { 203 226 // realloc message buffer to the correct size 227 #ifdef VBOX_USE_IPRT_IN_XPCOM 228 mMsgHdr = (ipcMessageHeader *) RTMemRealloc(mMsgHdr, MsgLen()); 229 #else 204 230 mMsgHdr = (ipcMessageHeader *) realloc(mMsgHdr, MsgLen()); 231 #endif 205 232 } 206 233 } … … 212 239 // allocate a partial buffer 213 240 PRUint32 msgLen = IPC_MSG_GUESSED_SIZE; 241 #ifdef VBOX_USE_IPRT_IN_XPCOM 242 mMsgHdr = (ipcMessageHeader *) RTMemAlloc(msgLen); 243 #else 214 244 mMsgHdr = (ipcMessageHeader *) malloc(msgLen); 245 #endif 215 246 if (!mMsgHdr) 216 247 return PR_FAILURE; … … 223 254 else { 224 255 PRUint32 msgLen = *(PRUint32 *) buf; 256 #ifdef VBOX_USE_IPRT_IN_XPCOM 257 mMsgHdr = (ipcMessageHeader *) RTMemAlloc(msgLen); 258 #else 225 259 mMsgHdr = (ipcMessageHeader *) malloc(msgLen); 260 #endif 226 261 if (!mMsgHdr) 227 262 return PR_FAILURE; -
trunk/src/libs/xpcom18a4/ipc/ipcd/util/src/ipcMessageWriter.cpp
r1 r31259 40 40 #include "prmem.h" 41 41 #include <string.h> 42 #ifdef VBOX_USE_IPRT_IN_XPCOM 43 # include <iprt/mem.h> 44 #endif 42 45 43 46 //***************************************************************************** 44 47 // ipcMessageWriter 45 //***************************************************************************** 48 //***************************************************************************** 46 49 47 50 ipcMessageWriter::~ipcMessageWriter() 48 51 { 49 52 if (mBuf) 53 #ifdef VBOX_USE_IPRT_IN_XPCOM 54 RTMemFree(mBuf); 55 #else 50 56 free(mBuf); 57 #endif 51 58 } 52 59 53 60 void ipcMessageWriter::PutInt8(PRUint8 val) 54 61 { 55 if (EnsureCapacity(sizeof(PRUint8))) 62 if (EnsureCapacity(sizeof(PRUint8))) 56 63 *mBufPtr++ = val; 57 64 } … … 60 67 // are larger than a byte. On some platforms, that causes a performance penalty. 61 68 // On other platforms, Tru64 for instance, it's an error. 62 69 63 70 void ipcMessageWriter::PutInt16(PRUint16 val) 64 71 { … … 70 77 } 71 78 } 72 79 73 80 void ipcMessageWriter::PutInt32(PRUint32 val) 74 81 { … … 79 86 *mBufPtr++ = temp[1]; 80 87 *mBufPtr++ = temp[2]; 81 *mBufPtr++ = temp[3]; 88 *mBufPtr++ = temp[3]; 82 89 } 83 90 } 84 91 85 92 PRUint32 ipcMessageWriter::PutBytes(const void* src, PRUint32 n) 86 93 { … … 92 99 return 0; 93 100 } 94 101 95 102 PRBool ipcMessageWriter::GrowCapacity(PRInt32 sizeNeeded) 96 103 { … … 107 114 return PR_FALSE; 108 115 } 109 116 110 117 PRInt32 curPos = mBufPtr - mBuf; 118 #ifdef VBOX_USE_IPRT_IN_XPCOM 119 mBuf = (PRUint8*)RTMemRealloc(mBuf, mCapacity); 120 #else 111 121 mBuf = (PRUint8*)realloc(mBuf, mCapacity); 122 #endif 112 123 if (!mBuf) { 113 124 mError = PR_TRUE; -
trunk/src/libs/xpcom18a4/nsprpub/lib/libc/src/strdup.c
r1 r31259 39 39 #include "prmem.h" 40 40 #include <string.h> 41 #ifdef VBOX_USE_IPRT_IN_NSPR 42 #include <iprt/mem.h> 43 #endif 41 44 42 45 PR_IMPLEMENT(char *) … … 51 54 n = strlen(s) + 1; 52 55 56 #ifdef VBOX_USE_IPRT_IN_NSPR 57 rv = (char *)RTMemAlloc(n); 58 #else 53 59 rv = (char *)malloc(n); 60 #endif 54 61 if( (char *)0 == rv ) return rv; 55 62 … … 62 69 PL_strfree(char *s) 63 70 { 71 #ifdef VBOX_USE_IPRT_IN_NSPR 72 RTMemFree(s); 73 #else 64 74 free(s); 75 #endif 65 76 } 66 77 … … 76 87 l = PL_strnlen(s, max); 77 88 89 #ifdef VBOX_USE_IPRT_IN_NSPR 90 rv = (char *)RTMemAlloc(l+1); 91 #else 78 92 rv = (char *)malloc(l+1); 93 #endif 79 94 if( (char *)0 == rv ) return rv; 80 95 -
trunk/src/libs/xpcom18a4/nsprpub/pr/src/io/prlog.c
r11858 r31259 51 51 52 52 #if defined(VBOX) && defined(DEBUG) 53 #include <iprt/initterm.h> /* for RTR3Init */ 54 #include <iprt/log.h> 53 # include <iprt/initterm.h> /* for RTR3Init */ 54 # include <iprt/log.h> 55 #endif 56 #ifdef VBOX_USE_IPRT_IN_NSPR 57 # include <iprt/string.h> 55 58 #endif 56 59 … … 337 340 while (lm != NULL) { 338 341 PRLogModuleInfo *next = lm->next; 342 #ifdef VBOX_USE_IPRT_IN_NSPR 343 RTStrFree((/*const*/ char *)lm->name); 344 #else 339 345 free((/*const*/ char *)lm->name); 346 #endif 340 347 PR_Free(lm); 341 348 lm = next; … … 395 402 lm = PR_NEWZAP(PRLogModuleInfo); 396 403 if (lm) { 404 #ifdef VBOX_USE_IPRT_IN_NSPR 405 lm->name = RTStrDup(name); 406 #else 397 407 lm->name = strdup(name); 408 #endif 398 409 lm->level = PR_LOG_NONE; 399 410 lm->next = logModules; -
trunk/src/libs/xpcom18a4/nsprpub/pr/src/linking/prlink.c
r16397 r31259 113 113 114 114 #endif /* !VBOX_USE_MORE_IPRT_IN_NSPR */ 115 #ifdef VBOX_USE_IPRT_IN_NSPR 116 # include <iprt/mem.h> 117 # include <iprt/string.h> 118 # undef strdup 119 # define strdup(str) RTStrDup(str) 120 #endif 115 121 116 122 #define _PR_DEFAULT_LD_FLAGS PR_LD_LAZY … … 418 424 419 425 if (_pr_currentLibPath) { 426 #ifdef VBOX_USE_IPRT_IN_NSPR 427 RTStrFree(_pr_currentLibPath); 428 #else 420 429 free(_pr_currentLibPath); 430 #endif 421 431 _pr_currentLibPath = NULL; 422 432 } … … 437 447 PR_EnterMonitor(pr_linker_lock); 438 448 if (_pr_currentLibPath) { 449 #ifdef VBOX_USE_IPRT_IN_NSPR 450 RTStrFree(_pr_currentLibPath); 451 #else 439 452 free(_pr_currentLibPath); 453 #endif 440 454 } 441 455 if (path) { … … 488 502 489 503 len = strlen(ev) + 1; /* +1 for the null */ 504 # ifdef VBOX_USE_IPRT_IN_NSPR 505 p = (char*) RTStrAlloc(len); 506 # else 490 507 p = (char*) malloc(len); 508 # endif 491 509 if (p) { 492 510 strcpy(p, ev); … … 519 537 len = strlen(ev) + 1; /* +1 for the null */ 520 538 539 # ifdef VBOX_USE_IPRT_IN_NSPR 540 p = (char*) RTStrAlloc(len); 541 # else 521 542 p = (char*) malloc(len); 543 # endif 522 544 if (p) { 523 545 strcpy(p, ev); … … 530 552 /* AFAIK there isn't a library path with the HP SHL interface --Rob */ 531 553 ev = strdup(""); 532 # endif554 # endif 533 555 #endif 534 556 … … 540 562 exit: 541 563 if (_pr_currentLibPath) { 564 #ifdef VBOX_USE_IPRT_IN_NSPR 565 copy = RTMemDup(_pr_currentLibPath, strlen(_pr_currentLibPath) + 1); 566 #else 542 567 copy = strdup(_pr_currentLibPath); 568 #endif 543 569 } 544 570 PR_ExitMonitor(pr_linker_lock); … … 1475 1501 freeLib: 1476 1502 PR_LOG(_pr_linker_lm, PR_LOG_MIN, ("Unloaded library %s", lib->name)); 1503 #ifdef VBOX_USE_IPRT_IN_NSPR 1504 RTStrFree(lib->name); 1505 #else 1477 1506 free(lib->name); 1507 #endif 1478 1508 lib->name = NULL; 1479 1509 PR_DELETE(lib); -
trunk/src/libs/xpcom18a4/nsprpub/pr/src/malloc/prmem.c
r31253 r31259 41 41 42 42 #include "primpl.h" 43 #ifdef VBOX_USE_ MORE_IPRT_IN_NSPR43 #ifdef VBOX_USE_IPRT_IN_NSPR 44 44 # include <iprt/mem.h> 45 45 #endif … … 108 108 MemBlockHdr *hdr = mz->head; 109 109 mz->head = hdr->s.next; /* unlink it */ 110 #ifdef VBOX_USE_IPRT_IN_NSPR 111 RTMemFree(hdr); 112 #else 110 113 free(hdr); 114 #endif 111 115 mz->elements--; 112 116 } … … 281 285 pthread_mutex_unlock(&mz->lock); 282 286 287 #ifdef VBOX_USE_IPRT_IN_NSPR 288 mb = (MemBlockHdr *)RTMemAlloc(blockSize + 2 * (sizeof *mb)); 289 #else 283 290 mb = (MemBlockHdr *)malloc(blockSize + 2 * (sizeof *mb)); 291 #endif 284 292 if (!mb) { 285 293 PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0); … … 301 309 /* size was too big. Create a block with no zone */ 302 310 blockSize = (size & 15) ? size + 16 - (size & 15) : size; 311 #ifdef VBOX_USE_IPRT_IN_NSPR 312 mb = (MemBlockHdr *)RTMemAlloc(blockSize + 2 * (sizeof *mb)); 313 #else 303 314 mb = (MemBlockHdr *)malloc(blockSize + 2 * (sizeof *mb)); 315 #endif 304 316 if (!mb) { 305 317 PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0); … … 351 363 #endif 352 364 /* We don't know how big it is. But we can fix that. */ 365 #ifdef VBOX_USE_IPRT_IN_NSPR 366 oldptr = RTMemRealloc(oldptr, bytes); 367 #else 353 368 oldptr = realloc(oldptr, bytes); 369 #endif 354 370 if (!oldptr) { 355 371 if (bytes) { … … 384 400 pr_ZoneFree(oldptr); 385 401 else if (oldptr) 402 #ifdef VBOX_USE_IPRT_IN_NSPR 403 RTMemFree(oldptr); 404 #else 386 405 free(oldptr); 406 #endif 387 407 } 388 408 return rv; … … 408 428 "Warning: freeing memory block %p from ordinary malloc\n", ptr); 409 429 #endif 430 #ifdef VBOX_USE_IPRT_IN_NSPR 431 RTMemFree(ptr); 432 #else 410 433 free(ptr); 434 #endif 411 435 return; 412 436 } … … 421 445 PR_ASSERT(blockSize > 65536); 422 446 /* This block was not in any zone. Just free it. */ 447 #ifdef VBOX_USE_IPRT_IN_NSPR 448 RTMemFree(mb); 449 #else 423 450 free(mb); 451 #endif 424 452 return; 425 453 } … … 441 469 if (!_pr_initialized) _PR_ImplicitInitialization(); 442 470 443 #ifdef VBOX_USE_ MORE_IPRT_IN_NSPR471 #ifdef VBOX_USE_IPRT_IN_NSPR 444 472 return use_zone_allocator ? pr_ZoneMalloc(size) : RTMemAlloc(size); 445 473 #else … … 453 481 454 482 return use_zone_allocator ? 455 #ifdef VBOX_USE_ MORE_IPRT_IN_NSPR483 #ifdef VBOX_USE_IPRT_IN_NSPR 456 484 pr_ZoneCalloc(nelem, elsize) : RTMemAllocZ(nelem * (size_t)elsize); 457 485 #else … … 464 492 if (!_pr_initialized) _PR_ImplicitInitialization(); 465 493 466 #ifdef VBOX_USE_ MORE_IPRT_IN_NSPR494 #ifdef VBOX_USE_IPRT_IN_NSPR 467 495 return use_zone_allocator ? pr_ZoneRealloc(ptr, size) : RTMemRealloc(ptr, size); 468 496 #else … … 476 504 pr_ZoneFree(ptr); 477 505 else 478 #ifdef VBOX_USE_ MORE_IPRT_IN_NSPR506 #ifdef VBOX_USE_IPRT_IN_NSPR 479 507 RTMemFree(ptr); 480 508 #else … … 498 526 return PR_MD_malloc( (size_t) size); 499 527 #else 500 # ifdef VBOX_USE_ MORE_IPRT_IN_NSPR528 # ifdef VBOX_USE_IPRT_IN_NSPR 501 529 return RTMemAlloc(size); 502 530 # else … … 512 540 513 541 #else 514 # ifdef VBOX_USE_ MORE_IPRT_IN_NSPR542 # ifdef VBOX_USE_IPRT_IN_NSPR 515 543 return RTMemAllocZ(nelem * (size_t)elsize); 516 544 # else … … 525 553 return PR_MD_realloc( ptr, (size_t) size); 526 554 #else 527 # ifdef VBOX_USE_ MORE_IPRT_IN_NSPR555 # ifdef VBOX_USE_IPRT_IN_NSPR 528 556 return RTMemRealloc(ptr, size); 529 557 # else … … 538 566 PR_MD_free( ptr ); 539 567 #else 540 # ifdef VBOX_USE_ MORE_IPRT_IN_NSPR568 # ifdef VBOX_USE_IPRT_IN_NSPR 541 569 RTMemFree(ptr); 542 570 # else -
trunk/src/libs/xpcom18a4/nsprpub/pr/src/misc/prdtoa.c
r1 r31259 267 267 #endif 268 268 #else 269 # ifdef VBOX_USE_IPRT_IN_NSPR 270 # include <iprt/mem.h> 271 # define MALLOC RTMemAlloc 272 # else 269 273 #define MALLOC malloc 274 # endif 270 275 #endif 271 276 … … 3419 3424 } 3420 3425 freedtoa(result); 3421 return rv; 3426 return rv; 3422 3427 } 3423 3428 … … 3427 3432 ** point value. 3428 3433 ** This should be reparameterized so that you can send in a 3429 ** prcn for the positive and negative ranges. For now, 3434 ** prcn for the positive and negative ranges. For now, 3430 3435 ** conform to the ECMA JavaScript spec which says numbers 3431 3436 ** less than 1e-6 are in scientific notation. -
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.