Remove tracing of memory allocations. Change-Id: Ia906e27d2ded0cafb1c597a369e7a5fe58b0bae1 Reviewed-on: https://swiftshader-review.googlesource.com/3020 Reviewed-by: Greg Hartman <ghartman@google.com> Reviewed-by: Nicolas Capens <capn@google.com> Tested-by: Nicolas Capens <capn@google.com>
diff --git a/src/Common/Memory.cpp b/src/Common/Memory.cpp index b091ac7..c9388f6 100644 --- a/src/Common/Memory.cpp +++ b/src/Common/Memory.cpp
@@ -31,6 +31,8 @@ #undef allocateZero #undef deallocateZero +namespace sw +{ size_t memoryPageSize() { static int pageSize = 0; @@ -123,36 +125,4 @@ 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); - } }
diff --git a/src/Common/Memory.hpp b/src/Common/Memory.hpp index d6a115d..36b84e5 100644 --- a/src/Common/Memory.hpp +++ b/src/Common/Memory.hpp
@@ -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 *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