Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/gpgmm/common/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ source_set("gpgmm_common_sources") {
"ConditionalMemoryAllocator.h",
"DedicatedMemoryAllocator.cpp",
"DedicatedMemoryAllocator.h",
"Defaults.h",
"Error.h",
"EventMessage.cpp",
"EventMessage.h",
Expand Down
1 change: 0 additions & 1 deletion src/gpgmm/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ target_sources(gpgmm_common PRIVATE
"ConditionalMemoryAllocator.h"
"DedicatedMemoryAllocator.cpp"
"DedicatedMemoryAllocator.h"
"Defaults.h"
"Error.h"
"EventTraceWriter.cpp"
"EventTraceWriter.h"
Expand Down
26 changes: 0 additions & 26 deletions src/gpgmm/common/Defaults.h

This file was deleted.

3 changes: 2 additions & 1 deletion src/gpgmm/common/EventTraceWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

#include "gpgmm/common/EventTraceWriter.h"

#include "gpgmm/common/Defaults.h"
#include "gpgmm/utils/Assert.h"
#include "gpgmm/utils/Log.h"
#include "gpgmm/utils/PlatformTime.h"
Expand All @@ -28,6 +27,8 @@

namespace gpgmm {

static constexpr const char* kDefaultTraceFile = "gpgmm_event_trace.json";

// Trace buffer that flushes and unlinks itself from the cache once destroyed.
class ScopedTraceBufferInTLS {
public:
Expand Down
9 changes: 9 additions & 0 deletions src/gpgmm/common/MemoryAllocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,15 @@ namespace gpgmm {
MemoryAllocatorStats& operator+=(const MemoryAllocatorStats& rhs);
};

// Amount of memory, expressed as a percentage of memory, that is acceptable to waste
// to fragmentation. For example, a 6 byte request may require 8 bytes (eg. power-of-two) or 25%
// fragmentation.
static constexpr float kDefaultMemoryFragmentationLimit = 0.125f; // 1/8th or 12.5%

// Amount of memory, expressed as a perecentage memory size, that can
// increased per allocation. For example, a 2.0 factor means the memory size can double.
static constexpr float kDefaultMemoryGrowthFactor = 1.25f; // 25% growth

class BlockAllocator;

// MemoryAllocatorBase services a fixed or variable sized MemoryAllocationRequest.
Expand Down
1 change: 0 additions & 1 deletion src/gpgmm/d3d12/ResourceAllocatorD3D12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

#include "gpgmm/common/BuddyMemoryAllocator.h"
#include "gpgmm/common/DedicatedMemoryAllocator.h"
#include "gpgmm/common/Defaults.h"
#include "gpgmm/common/EventMessage.h"
#include "gpgmm/common/PooledMemoryAllocator.h"
#include "gpgmm/common/SegmentedMemoryAllocator.h"
Expand Down
1 change: 0 additions & 1 deletion src/gpgmm/vk/ResourceAllocatorVk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include "gpgmm/vk/ResourceAllocatorVk.h"

#include "gpgmm/common/BuddyMemoryAllocator.h"
#include "gpgmm/common/Defaults.h"
#include "gpgmm/common/EventMessage.h"
#include "gpgmm/common/Object.h"
#include "gpgmm/common/PooledMemoryAllocator.h"
Expand Down