VirtualBox

Ignore:
Timestamp:
Aug 26, 2015 8:32:20 AM (9 years ago)
Author:
vboxsync
Message:

SharedOpenGL: Use RTMemAlloc and friends to allocate memory, so we can make use of the electrical fence for debugging everywhere

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/OpenGL/util/mem.c

    r53726 r57541  
    1212
    1313#include <iprt/types.h>
     14#include <iprt/mem.h>
    1415
    1516#if DEBUG_MEM
     
    4445#endif
    4546{
     47#ifdef VBOX
     48        void *ret = RTMemAlloc( nbytes );
     49#else
    4650        void *ret = malloc( nbytes );
     51#endif
    4752        if (!ret) {
    4853                crError( "Out of memory trying to allocate %d bytes!", nbytes );
     
    6974#endif
    7075{
     76#ifdef VBOX
     77        void *ret = RTMemAlloc( nbytes );
     78#else
    7179        void *ret = malloc( nbytes );
     80#endif
    7281        if (!ret) {
    7382                crError( "Out of memory trying to (c)allocate %d bytes!", nbytes );
     
    109118DECLEXPORT(void) crFree( void *ptr )
    110119{
     120#ifdef VBOX
     121        if (ptr)
     122                RTMemFree(ptr);
     123#else
    111124        if (ptr)
    112125                free(ptr);
     126#endif
    113127}
    114128
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