Skip to content

Commit

Permalink
fix(build): Use new memory system in samples.
Browse files Browse the repository at this point in the history
  • Loading branch information
na2axl committed Oct 26, 2024
1 parent b2103f6 commit 1e8ee6d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions include/SparkyStudios/Audio/Amplitude/Core/Memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ namespace SparkyStudios::Audio::Amplitude
*
* @ingroup memory
*/
class DefaultMemoryAllocator final : public MemoryAllocator
class AM_API_PUBLIC DefaultMemoryAllocator final : public MemoryAllocator
{
public:
/**
Expand Down Expand Up @@ -528,7 +528,7 @@ namespace SparkyStudios::Audio::Amplitude
/**
* @brief Checks if the address matches the provided pointer.
*
* @param[in] ptr The pointer to compare with.
* @param[in] other The pointer to compare with.
*
* @return `true` if the addresses match, `false` otherwise.
*/
Expand Down
2 changes: 1 addition & 1 deletion samples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ add_subdirectory(sample_01)
add_subdirectory(sample_02)

install(
CODE "execute_process(COMMAND python3 ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/build_project.py -p ${CMAKE_SOURCE_DIR}/sample_project -b ${CMAKE_INSTALL_PREFIX}/${AM_BIN_DESTINATION}/samples/assets -f ${CMAKE_SOURCE_DIR}/bin/flatc WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})"
CODE "execute_process(COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/build_project.py -p ${CMAKE_SOURCE_DIR}/sample_project -b ${CMAKE_INSTALL_PREFIX}/${AM_BIN_DESTINATION}/samples/assets -f ${CMAKE_SOURCE_DIR}/bin/flatc WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})"
)

install(
Expand Down
8 changes: 4 additions & 4 deletions samples/sample_01/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ struct ExecutionContext
#if !defined(AM_NO_MEMORY_STATS)
static void printMemoryStats()
{
std::vector<MemoryPoolKind> pools = {
MemoryPoolKind::Amplimix, MemoryPoolKind::Codec, MemoryPoolKind::Engine, MemoryPoolKind::Filtering,
MemoryPoolKind::SoundData, MemoryPoolKind::IO, MemoryPoolKind::Default,
std::vector<eMemoryPoolKind> pools = {
eMemoryPoolKind_Amplimix, eMemoryPoolKind_Codec, eMemoryPoolKind_Engine, eMemoryPoolKind_Filtering,
eMemoryPoolKind_SoundData, eMemoryPoolKind_IO, eMemoryPoolKind_Default,
};

for (auto&& kind : pools)
Expand Down Expand Up @@ -314,7 +314,7 @@ int main(int argc, char* argv[])

Logger::SetLogger(&logger);

MemoryManager::Initialize(MemoryManagerConfig());
MemoryManager::Initialize();

ExecutionContext ctx{};
auto t = Thread::CreateThread(run, &ctx);
Expand Down
2 changes: 1 addition & 1 deletion samples/sample_02/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ AmInt32 main(AmInt32 argc, char* argv[])
ConsoleLogger logger;
Logger::SetLogger(&logger);

MemoryManager::Initialize(MemoryManagerConfig());
MemoryManager::Initialize();

if (SampleState sample; !sample.Initialize())
fprintf(stderr, "Failed to initialize!\n");
Expand Down

0 comments on commit 1e8ee6d

Please sign in to comment.