VirtualBox

Changeset 101774 in vbox for trunk/src/libs


Ignore:
Timestamp:
Nov 4, 2023 6:03:10 PM (16 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
159870
Message:

libs/xpcom: Reduce code clutter by making our code the only variant being used, bugref:10545

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/nsprpub/pr/src/malloc/prmem.c

    r101773 r101774  
    4141
    4242#include "primpl.h"
    43 #ifdef VBOX_USE_IPRT_IN_NSPR
    44 # include <iprt/mem.h>
    45 #endif
     43#include <iprt/mem.h>
    4644
    4745/*
     
    5553PR_IMPLEMENT(void *) PR_Malloc(PRUint32 size)
    5654{
    57 #if defined (WIN16)
    58     return PR_MD_malloc( (size_t) size);
    59 #else
    60 # ifdef VBOX_USE_IPRT_IN_NSPR
    6155    return RTMemAlloc(RT_MAX(size, 1));
    62 # else
    63     return malloc(size);
    64 # endif
    65 #endif
    6656}
    6757
    6858PR_IMPLEMENT(void *) PR_Calloc(PRUint32 nelem, PRUint32 elsize)
    6959{
    70 #if defined (WIN16)
    71     return PR_MD_calloc( (size_t)nelem, (size_t)elsize );
    72 
    73 #else
    74 # ifdef VBOX_USE_IPRT_IN_NSPR
    7560    return RTMemAllocZ(RT_MAX(nelem * (size_t)elsize, 1));
    76 # else
    77     return calloc(nelem, elsize);
    78 # endif
    79 #endif
    8061}
    8162
    8263PR_IMPLEMENT(void *) PR_Realloc(void *ptr, PRUint32 size)
    8364{
    84 #if defined (WIN16)
    85     return PR_MD_realloc( ptr, (size_t) size);
    86 #else
    87 # ifdef VBOX_USE_IPRT_IN_NSPR
    8865    return RTMemRealloc(ptr, size);
    89 # else
    90     return realloc(ptr, size);
    91 # endif
    92 #endif
    9366}
    9467
    9568PR_IMPLEMENT(void) PR_Free(void *ptr)
    9669{
    97 #if defined (WIN16)
    98     PR_MD_free( ptr );
    99 #else
    100 # ifdef VBOX_USE_IPRT_IN_NSPR
    10170    RTMemFree(ptr);
    102 # else
    103     free(ptr);
    104 # endif
    105 #endif
    10671}
    10772
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