From be54c3f3ed192eabab9b075ec924d2479a956b9d Mon Sep 17 00:00:00 2001 From: "alkondratenko@gmail.com" Date: Fri, 26 Jul 2013 19:34:54 +0000 Subject: issue-556: dll-export TCMalloc_System{Alloc,Release} because page_heap_test is using this stuff git-svn-id: http://gperftools.googlecode.com/svn/trunk@229 6b5cf1ce-ec42-a296-1ba9-69fdba395a50 --- src/system-alloc.h | 8 +++++--- src/windows/port.cc | 6 ++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/system-alloc.h b/src/system-alloc.h index 2d49fc3..89240cd 100644 --- a/src/system-alloc.h +++ b/src/system-alloc.h @@ -57,8 +57,9 @@ class SysAllocator; // aligned. // // Returns NULL when out of memory. -extern void* TCMalloc_SystemAlloc(size_t bytes, size_t *actual_bytes, - size_t alignment = 0); +extern PERFTOOLS_DLL_DECL +void* TCMalloc_SystemAlloc(size_t bytes, size_t *actual_bytes, + size_t alignment = 0); // This call is a hint to the operating system that the pages // contained in the specified range of memory will not be used for a @@ -71,7 +72,8 @@ extern void* TCMalloc_SystemAlloc(size_t bytes, size_t *actual_bytes, // be released, partial pages will not.) // // Returns false if release failed or not supported. -extern bool TCMalloc_SystemRelease(void* start, size_t length); +extern PERFTOOLS_DLL_DECL +bool TCMalloc_SystemRelease(void* start, size_t length); // The current system allocator. extern PERFTOOLS_DLL_DECL SysAllocator* sys_alloc; diff --git a/src/windows/port.cc b/src/windows/port.cc index 641c3c9..591e3a8 100644 --- a/src/windows/port.cc +++ b/src/windows/port.cc @@ -225,8 +225,9 @@ size_t TCMalloc_SystemTaken = 0; // This is mostly like MmapSysAllocator::Alloc, except it does these weird // munmap's in the middle of the page, which is forbidden in windows. -extern void* TCMalloc_SystemAlloc(size_t size, size_t *actual_size, - size_t alignment) { +extern PERFTOOLS_DLL_DECL +void* TCMalloc_SystemAlloc(size_t size, size_t *actual_size, + size_t alignment) { // Align on the pagesize boundary const int pagesize = getpagesize(); if (alignment < pagesize) alignment = pagesize; @@ -261,6 +262,7 @@ extern void* TCMalloc_SystemAlloc(size_t size, size_t *actual_size, return reinterpret_cast(ptr); } +extern PERFTOOLS_DLL_DECL bool TCMalloc_SystemRelease(void* start, size_t length) { // TODO(csilvers): should I be calling VirtualFree here? return false; -- cgit v1.2.1