mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-01 15:21:00 +00:00
[Allocator] Hoist the external helper function into a namespace scope
declaration. GCC 4.7 appears to get hopelessly confused by declaring this function within a member function of a class template. Go figure. llvm-svn: 206152
This commit is contained in:
parent
10755b471b
commit
feba5396be
@ -67,6 +67,14 @@ public:
|
||||
void Deallocate(void *Slab, size_t Size) { Allocator.Deallocate(Slab); }
|
||||
};
|
||||
|
||||
namespace detail {
|
||||
|
||||
// We call out to an external function to actually print the message as the
|
||||
// printing code uses Allocator.h in its implementation.
|
||||
void printBumpPtrAllocatorStats(unsigned NumSlabs, size_t BytesAllocated,
|
||||
size_t TotalMemory);
|
||||
} // End namespace detail.
|
||||
|
||||
/// \brief Allocate memory in an ever growing pool, as if by bump-pointer.
|
||||
///
|
||||
/// This isn't strictly a bump-pointer allocator as it uses backing slabs of
|
||||
@ -200,12 +208,8 @@ public:
|
||||
}
|
||||
|
||||
void PrintStats() const {
|
||||
// We call out to an external function to actually print the message as the
|
||||
// printing code uses Allocator.h in its implementation.
|
||||
extern void printBumpPtrAllocatorStats(
|
||||
unsigned NumSlabs, size_t BytesAllocated, size_t TotalMemory);
|
||||
|
||||
printBumpPtrAllocatorStats(Slabs.size(), BytesAllocated, getTotalMemory());
|
||||
detail::printBumpPtrAllocatorStats(Slabs.size(), BytesAllocated,
|
||||
getTotalMemory());
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -21,6 +21,8 @@
|
||||
|
||||
namespace llvm {
|
||||
|
||||
namespace detail {
|
||||
|
||||
void printBumpPtrAllocatorStats(unsigned NumSlabs, size_t BytesAllocated,
|
||||
size_t TotalMemory) {
|
||||
errs() << "\nNumber of memory regions: " << NumSlabs << '\n'
|
||||
@ -30,6 +32,8 @@ void printBumpPtrAllocatorStats(unsigned NumSlabs, size_t BytesAllocated,
|
||||
<< " (includes alignment, etc)\n";
|
||||
}
|
||||
|
||||
} // End namespace detail.
|
||||
|
||||
void PrintRecyclerStats(size_t Size,
|
||||
size_t Align,
|
||||
size_t FreeListSize) {
|
||||
|
Loading…
Reference in New Issue
Block a user