diff options
author | 2017-01-11 16:39:35 -0800 | |
---|---|---|
committer | 2017-01-11 16:45:22 -0800 | |
commit | 83c6e0c63acdcab2c58c4ed7220bfa58879b1d57 (patch) | |
tree | b04adda58043fd87b95940a675e065d21c0aef24 /tensorflow/core/platform/mem.h | |
parent | 99e1b19ceba32b8354dddc2841b81864c9ba96bb (diff) |
Switch open-source to use jemalloc for CPU Tensor memory allocation, gRPC, and other places where we call malloc/free.
- Only enabled on Linux for now.
- Added as a ./configure option defaulting to enabled.
Change: 144266237
Diffstat (limited to 'tensorflow/core/platform/mem.h')
-rw-r--r-- | tensorflow/core/platform/mem.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tensorflow/core/platform/mem.h b/tensorflow/core/platform/mem.h index 6618145c3d..dc389a8741 100644 --- a/tensorflow/core/platform/mem.h +++ b/tensorflow/core/platform/mem.h @@ -24,9 +24,14 @@ limitations under the License. namespace tensorflow { namespace port { -// Aligned allocation/deallocation -void* aligned_malloc(size_t size, int minimum_alignment); -void aligned_free(void* aligned_memory); +// Aligned allocation/deallocation. `minimum_alignment` must be a power of 2 +// and a multiple of sizeof(void*). +void* AlignedMalloc(size_t size, int minimum_alignment); +void AlignedFree(void* aligned_memory); + +void* Malloc(size_t size); +void* Realloc(void* ptr, size_t size); +void Free(void* ptr); // Tries to release num_bytes of free memory back to the operating // system for reuse. Use this routine with caution -- to get this |