Import all sources from perforce.
This commit is contained in:
34
src/nvcore/Memory.cpp
Normal file
34
src/nvcore/Memory.cpp
Normal file
@ -0,0 +1,34 @@
|
||||
|
||||
#include "Memory.h"
|
||||
#include "Debug.h"
|
||||
|
||||
//#if HAVE_MALLOC_H
|
||||
//#include <malloc.h>
|
||||
//#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
using namespace nv;
|
||||
|
||||
void * nv::mem::malloc(size_t size)
|
||||
{
|
||||
return ::malloc(size);
|
||||
}
|
||||
|
||||
void * nv::mem::malloc(size_t size, const char * file, int line)
|
||||
{
|
||||
return ::malloc(size);
|
||||
}
|
||||
|
||||
void nv::mem::free(const void * ptr)
|
||||
{
|
||||
::free(const_cast<void *>(ptr));
|
||||
}
|
||||
|
||||
void * nv::mem::realloc(void * ptr, size_t size)
|
||||
{
|
||||
nvDebugCheck(ptr != NULL || size != 0); // undefined realloc behavior.
|
||||
return ::realloc(ptr, size);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user