Add feature to profile memory allocation with Tracy

This commit is contained in:
Imbris 2021-07-30 01:01:17 -04:00
parent 8827d40660
commit c4ec279121
2 changed files with 7 additions and 0 deletions

View File

@ -28,6 +28,7 @@ hot-reloading = ["common/hot-reloading"]
singleplayer = ["server"]
simd = ["vek/platform_intrinsics"]
tracy = ["profiling", "profiling/profile-with-tracy", "common-frontend/tracy", "client/tracy"]
tracy-memory = ["tracy"] # enables heap profiling with tracy
plugins = ["client/plugins"]
egui-ui = ["voxygen-egui", "egui", "egui_wgpu_backend", "egui_winit_platform"]

View File

@ -2,6 +2,12 @@
#![feature(bool_to_option)]
#![recursion_limit = "2048"]
// Allow profiling allocations with Tracy
#[cfg_attr(feature = "tracy-memory", global_allocator)]
#[cfg(feature = "tracy-memory")]
static GLOBAL: common_base::tracy_client::ProfiledAllocator<std::alloc::System> =
common_base::tracy_client::ProfiledAllocator::new(std::alloc::System, 128);
use i18n::{self, LocalizationHandle};
use veloren_voxygen::{
audio::AudioFrontend,