Commit 9ce854be by Nicolas Capens

Remove tracing of memory allocations.

Change-Id: Ia906e27d2ded0cafb1c597a369e7a5fe58b0bae1 Reviewed-on: https://swiftshader-review.googlesource.com/3020Reviewed-by: 's avatarGreg Hartman <ghartman@google.com> Reviewed-by: 's avatarNicolas Capens <capn@google.com> Tested-by: 's avatarNicolas Capens <capn@google.com>
parent a1961524
......@@ -31,6 +31,8 @@
#undef allocateZero
#undef deallocateZero
namespace sw
{
size_t memoryPageSize()
{
static int pageSize = 0;
......@@ -123,36 +125,4 @@ void deallocateExecutable(void *memory, size_t bytes)
deallocate(memory);
}
void *allocate(size_t bytes, const char *function)
{
trace("[0x%0.8X]%s(...)\n", 0xFFFFFFFF, function);
void *memory = allocate(bytes);
trace("\t0x%0.8X = allocate(%d)\n", memory, bytes);
return memory;
}
void *allocateZero(size_t bytes, const char *function)
{
trace("[0x%0.8X]%s(...)\n", 0xFFFFFFFF, function);
void *memory = allocateZero(bytes);
trace("\t0x%0.8X = allocateZero(%d)\n", memory, bytes);
return memory;
}
void deallocate(void *memory, const char *function)
{
if(memory)
{
trace("[0x%0.8X]%s(...)\n", 0xFFFFFFFF, function);
trace("\tdeallocate(0x%0.8X)\n", memory);
deallocate(memory);
}
}
......@@ -14,6 +14,8 @@
#include <stddef.h>
namespace sw
{
size_t memoryPageSize();
void *allocate(size_t bytes, size_t alignment = 16);
......@@ -23,15 +25,6 @@ void deallocate(void *memory);
void *allocateExecutable(size_t bytes); // Allocates memory that can be made executable using markExecutable()
void markExecutable(void *memory, size_t bytes);
void deallocateExecutable(void *memory, size_t bytes);
void *allocate(size_t bytes, const char *function);
void *allocateZero(size_t bytes, const char *function);
void deallocate(void *memory, const char *function);
#ifndef NDEBUG
#define allocate(bytes) allocate((bytes), __FUNCTION__)
#define allocateZero(bytes) allocateZero((bytes), __FUNCTION__)
#define deallocate(memory) deallocate((memory), __FUNCTION__)
#endif
}
#endif // Memory_hpp
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment