summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralkondratenko@gmail.com <alkondratenko@gmail.com@6b5cf1ce-ec42-a296-1ba9-69fdba395a50>2013-07-26 19:34:54 +0000
committeralkondratenko@gmail.com <alkondratenko@gmail.com@6b5cf1ce-ec42-a296-1ba9-69fdba395a50>2013-07-26 19:34:54 +0000
commitbe54c3f3ed192eabab9b075ec924d2479a956b9d (patch)
tree691c06105520267fb29ffd750b6ef488f79e8a4c
parente3716145cbfa1247fa37dd627b2136a061944255 (diff)
downloadgperftools-be54c3f3ed192eabab9b075ec924d2479a956b9d.tar.gz
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
-rw-r--r--src/system-alloc.h8
-rw-r--r--src/windows/port.cc6
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<void*>(ptr);
}
+extern PERFTOOLS_DLL_DECL
bool TCMalloc_SystemRelease(void* start, size_t length) {
// TODO(csilvers): should I be calling VirtualFree here?
return false;