VirtualBox

Changeset 103573 in vbox


Ignore:
Timestamp:
Feb 26, 2024 2:49:40 PM (9 months ago)
Author:
vboxsync
Message:

libs/xpcom: Replace the old ipcMessageWriter helper class with an inline version to avoid function calls in hot code paths, bugref:10597 [fixes for 0 byte memory allocation]

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/ipc/ipcd/client/src/ipcDConnectService.cpp

    r103571 r103573  
    25252525
    25262526  IPCMSGWRITER MsgWriter;
    2527   IPCMsgWriterInit(&MsgWriter, 16 * paramCount);
     2527  IPCMsgWriterInit(&MsgWriter, 64 + 16 * paramCount);
    25282528
    25292529  // INVOKE message header
     
    37023702  Log(("  request-index=%d\n", (PRUint32) invoke->request_index));
    37033703
    3704   params = (nsXPTCVariant *)RTMemAllocZ(sizeof(nsXPTCVariant) * paramCount);
    3705   if (!params)
    3706   {
    3707     rv = NS_ERROR_OUT_OF_MEMORY;
    3708     goto end;
     3704  if (paramCount)
     3705  {
     3706    params = (nsXPTCVariant *)RTMemAllocZ(sizeof(nsXPTCVariant) * paramCount);
     3707    if (!params)
     3708    {
     3709      rv = NS_ERROR_OUT_OF_MEMORY;
     3710      goto end;
     3711    }
    37093712  }
    37103713
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette