diff options
| author | Stefan Boberg <[email protected]> | 2025-10-28 22:34:52 +0100 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2025-10-28 22:34:52 +0100 |
| commit | 9c2cdc2345880f18b67af6b7b5c11d0ce9041ced (patch) | |
| tree | dc868fb7368df37e7c3645f4cadea8bf73303505 /src | |
| parent | 5.7.7 (diff) | |
| download | zen-9c2cdc2345880f18b67af6b7b5c11d0ce9041ced.tar.xz zen-9c2cdc2345880f18b67af6b7b5c11d0ce9041ced.zip | |
fix --zentrace=no compile errors (#616)
* make sure the correct `UE_WITH_TRACE` conditional is used to enable/disable support code as appropriate
* fixed some accidental `int32`, `int64` et al usage, due to typedefs leaking through from trace header
with this fix, it is now possible to build with `--zentrace=no` again
Diffstat (limited to 'src')
| -rw-r--r-- | src/zencore/include/zencore/memory/memorytrace.h | 6 | ||||
| -rw-r--r-- | src/zencore/include/zencore/memory/tagtrace.h | 5 | ||||
| -rw-r--r-- | src/zencore/memtrack/callstacktrace.cpp | 4 | ||||
| -rw-r--r-- | src/zencore/memtrack/callstacktrace.h | 2 | ||||
| -rw-r--r-- | src/zencore/memtrack/memorytrace.cpp | 6 | ||||
| -rw-r--r-- | src/zencore/memtrack/moduletrace.cpp | 2 | ||||
| -rw-r--r-- | src/zencore/memtrack/moduletrace_events.cpp | 4 | ||||
| -rw-r--r-- | src/zencore/memtrack/moduletrace_events.h | 4 | ||||
| -rw-r--r-- | src/zencore/memtrack/tagtrace.cpp | 8 | ||||
| -rw-r--r-- | src/zencore/memtrack/tracemalloc.h | 4 | ||||
| -rw-r--r-- | src/zenremotestore/jupiter/jupitersession.cpp | 2 | ||||
| -rw-r--r-- | src/zenserver/config/config.cpp | 2 | ||||
| -rw-r--r-- | src/zenserver/storage/projectstore/httpprojectstore.cpp | 4 | ||||
| -rw-r--r-- | src/zenstore/filecas.cpp | 16 |
14 files changed, 40 insertions, 29 deletions
diff --git a/src/zencore/include/zencore/memory/memorytrace.h b/src/zencore/include/zencore/memory/memorytrace.h index 6be7adb89..51bc78bde 100644 --- a/src/zencore/include/zencore/memory/memorytrace.h +++ b/src/zencore/include/zencore/memory/memorytrace.h @@ -16,7 +16,7 @@ # define PLATFORM_USES_FIXED_GMalloc_CLASS 0 #endif -#if !defined(UE_MEMORY_TRACE_ENABLED) && UE_TRACE_ENABLED +#if !defined(UE_MEMORY_TRACE_ENABLED) && ZEN_WITH_TRACE # if UE_MEMORY_TRACE_AVAILABLE # define UE_MEMORY_TRACE_ENABLED ZEN_WITH_MEMTRACK # endif @@ -63,7 +63,7 @@ enum class EMemoryTraceHeapAllocationFlags : uint8_t ENUM_CLASS_FLAGS(EMemoryTraceHeapAllocationFlags); //////////////////////////////////////////////////////////////////////////////// -enum class EMemoryTraceSwapOperation : uint8 +enum class EMemoryTraceSwapOperation : uint8_t { PageOut = 0, // Paged out to swap PageIn = 1, // Read from swap via page fault @@ -74,7 +74,7 @@ enum class EMemoryTraceSwapOperation : uint8 // Internal options for early initialization of memory tracing systems. Exposed // here due to visibility in platform implementations. -enum class EMemoryTraceInit : uint8 +enum class EMemoryTraceInit : uint8_t { Disabled = 0, AllocEvents = 1 << 0, diff --git a/src/zencore/include/zencore/memory/tagtrace.h b/src/zencore/include/zencore/memory/tagtrace.h index 8b5fc0e67..ebc9b2db4 100644 --- a/src/zencore/include/zencore/memory/tagtrace.h +++ b/src/zencore/include/zencore/memory/tagtrace.h @@ -23,7 +23,7 @@ inline constexpr int32_t TRACE_TAG = 257; # define UE_MEMORY_TAGS_TRACE_ENABLED 1 #endif -#if UE_MEMORY_TAGS_TRACE_ENABLED && UE_TRACE_ENABLED +#if UE_MEMORY_TAGS_TRACE_ENABLED && ZEN_WITH_TRACE namespace zen { //////////////////////////////////////////////////////////////////////////////// @@ -76,6 +76,8 @@ private: UE::Trace::Private::FScopedLogScope Inner; }; +} // namespace zen + //////////////////////////////////////////////////////////////////////////////// # define ZEN_MEMSCOPE(InTag) FMemScope PREPROCESSOR_JOIN(MemScope, __LINE__)(InTag); # define ZEN_MEMSCOPE_PTR(InPtr) FMemScopePtr PREPROCESSOR_JOIN(MemPtrScope, __LINE__)((uint64)InPtr); @@ -91,4 +93,3 @@ private: # define ZEN_MEMSCOPE_UNINITIALIZED(...) #endif // UE_MEMORY_TAGS_TRACE_ENABLED -} diff --git a/src/zencore/memtrack/callstacktrace.cpp b/src/zencore/memtrack/callstacktrace.cpp index d860c05d1..a5b7fede6 100644 --- a/src/zencore/memtrack/callstacktrace.cpp +++ b/src/zencore/memtrack/callstacktrace.cpp @@ -5,7 +5,7 @@ #include <zenbase/zenbase.h> #include <zencore/string.h> -#if UE_CALLSTACK_TRACE_ENABLED +#if UE_CALLSTACK_TRACE_ENABLED && ZEN_WITH_TRACE namespace zen { @@ -46,7 +46,7 @@ CallstackTrace_Initialize() #endif -#if ZEN_PLATFORM_WINDOWS +#if ZEN_PLATFORM_WINDOWS && ZEN_WITH_TRACE # include "moduletrace.h" # include "growonlylockfreehash.h" diff --git a/src/zencore/memtrack/callstacktrace.h b/src/zencore/memtrack/callstacktrace.h index 3e191490b..1118d3395 100644 --- a/src/zencore/memtrack/callstacktrace.h +++ b/src/zencore/memtrack/callstacktrace.h @@ -14,7 +14,7 @@ //////////////////////////////////////////////////////////////////////////////// #if !defined(UE_CALLSTACK_TRACE_ENABLED) -# if UE_TRACE_ENABLED +# if ZEN_WITH_TRACE # if ZEN_PLATFORM_WINDOWS # define UE_CALLSTACK_TRACE_ENABLED 1 # endif diff --git a/src/zencore/memtrack/memorytrace.cpp b/src/zencore/memtrack/memorytrace.cpp index 8f723866d..065a6f8ec 100644 --- a/src/zencore/memtrack/memorytrace.cpp +++ b/src/zencore/memtrack/memorytrace.cpp @@ -22,7 +22,7 @@ class FMalloc; -#if UE_TRACE_ENABLED +#if ZEN_WITH_TRACE namespace zen { UE_TRACE_CHANNEL_DEFINE(MemAllocChannel, "Memory allocations", true) } @@ -739,7 +739,7 @@ FTraceMalloc::~FTraceMalloc() ///////////////////////////////////////////////////////////////////////////// void* -FTraceMalloc::Malloc(SIZE_T Count, uint32_t Alignment) +FTraceMalloc::Malloc(size_t Count, uint32_t Alignment) { #if UE_MEMORY_TRACE_ENABLED // UE_TRACE_METADATA_CLEAR_SCOPE(); @@ -767,7 +767,7 @@ FTraceMalloc::Malloc(SIZE_T Count, uint32_t Alignment) ///////////////////////////////////////////////////////////////////////////// void* -FTraceMalloc::Realloc(void* Original, SIZE_T Count, uint32_t Alignment) +FTraceMalloc::Realloc(void* Original, size_t Count, uint32_t Alignment) { #if UE_MEMORY_TRACE_ENABLED // UE_TRACE_METADATA_CLEAR_SCOPE(); diff --git a/src/zencore/memtrack/moduletrace.cpp b/src/zencore/memtrack/moduletrace.cpp index cf37c5932..fdacc45e1 100644 --- a/src/zencore/memtrack/moduletrace.cpp +++ b/src/zencore/memtrack/moduletrace.cpp @@ -5,7 +5,7 @@ #include <zencore/memory/memorytrace.h> #include <zencore/memory/tagtrace.h> -#if ZEN_PLATFORM_WINDOWS +#if ZEN_PLATFORM_WINDOWS && ZEN_WITH_TRACE # define PLATFORM_SUPPORTS_TRACE_WIN32_MODULE_DIAGNOSTICS 1 #else # define PLATFORM_SUPPORTS_TRACE_WIN32_MODULE_DIAGNOSTICS 0 diff --git a/src/zencore/memtrack/moduletrace_events.cpp b/src/zencore/memtrack/moduletrace_events.cpp index 9c6a9b648..2df73b723 100644 --- a/src/zencore/memtrack/moduletrace_events.cpp +++ b/src/zencore/memtrack/moduletrace_events.cpp @@ -4,6 +4,8 @@ #include "moduletrace_events.h" +#if ZEN_WITH_TRACE + namespace zen { //////////////////////////////////////////////////////////////////////////////// @@ -14,3 +16,5 @@ UE_TRACE_EVENT_DEFINE(Diagnostics, ModuleLoad) UE_TRACE_EVENT_DEFINE(Diagnostics, ModuleUnload) } // namespace zen + +#endif diff --git a/src/zencore/memtrack/moduletrace_events.h b/src/zencore/memtrack/moduletrace_events.h index 1bda42fe8..d71189e79 100644 --- a/src/zencore/memtrack/moduletrace_events.h +++ b/src/zencore/memtrack/moduletrace_events.h @@ -3,6 +3,8 @@ #include <zencore/trace.h> +#if ZEN_WITH_TRACE + namespace zen { //////////////////////////////////////////////////////////////////////////////// @@ -25,3 +27,5 @@ UE_TRACE_EVENT_BEGIN_EXTERN(Diagnostics, ModuleUnload, NoSync | Important) UE_TRACE_EVENT_END() } // namespace zen + +#endif diff --git a/src/zencore/memtrack/tagtrace.cpp b/src/zencore/memtrack/tagtrace.cpp index 575b1fe53..473bd773b 100644 --- a/src/zencore/memtrack/tagtrace.cpp +++ b/src/zencore/memtrack/tagtrace.cpp @@ -6,7 +6,7 @@ #include "growonlylockfreehash.h" -#if UE_MEMORY_TAGS_TRACE_ENABLED && UE_TRACE_ENABLED +#if UE_MEMORY_TAGS_TRACE_ENABLED && ZEN_WITH_TRACE # include <zencore/string.h> @@ -210,7 +210,7 @@ namespace zen { void MemoryTrace_InitTags(FMalloc* InMalloc) { -#if UE_MEMORY_TAGS_TRACE_ENABLED && UE_TRACE_ENABLED +#if UE_MEMORY_TAGS_TRACE_ENABLED && ZEN_WITH_TRACE GTagTrace = (FTagTrace*)InMalloc->Malloc(sizeof(FTagTrace), alignof(FTagTrace)); new (GTagTrace) FTagTrace(InMalloc); #else @@ -222,7 +222,7 @@ MemoryTrace_InitTags(FMalloc* InMalloc) int32_t MemoryTrace_AnnounceCustomTag(int32_t Tag, int32_t ParentTag, const char* Display) { -#if UE_MEMORY_TAGS_TRACE_ENABLED && UE_TRACE_ENABLED +#if UE_MEMORY_TAGS_TRACE_ENABLED && ZEN_WITH_TRACE if (GTagTrace) { return GTagTrace->AnnounceCustomTag(Tag, ParentTag, Display); @@ -237,7 +237,7 @@ MemoryTrace_AnnounceCustomTag(int32_t Tag, int32_t ParentTag, const char* Displa int32_t MemoryTrace_GetActiveTag() { -#if UE_MEMORY_TAGS_TRACE_ENABLED && UE_TRACE_ENABLED +#if UE_MEMORY_TAGS_TRACE_ENABLED && ZEN_WITH_TRACE return GActiveTag; #else return -1; diff --git a/src/zencore/memtrack/tracemalloc.h b/src/zencore/memtrack/tracemalloc.h index 54606ac45..f82d630d7 100644 --- a/src/zencore/memtrack/tracemalloc.h +++ b/src/zencore/memtrack/tracemalloc.h @@ -12,8 +12,8 @@ public: FTraceMalloc(FMalloc* InMalloc); virtual ~FTraceMalloc(); - virtual void* Malloc(SIZE_T Count, uint32 Alignment) override; - virtual void* Realloc(void* Original, SIZE_T Count, uint32 Alignment) override; + virtual void* Malloc(size_t Count, uint32_t Alignment) override; + virtual void* Realloc(void* Original, size_t Count, uint32_t Alignment) override; virtual void Free(void* Original) override; virtual void OnMallocInitialized() override { WrappedMalloc->OnMallocInitialized(); } diff --git a/src/zenremotestore/jupiter/jupitersession.cpp b/src/zenremotestore/jupiter/jupitersession.cpp index 6a7938e7f..5a2bf9fe8 100644 --- a/src/zenremotestore/jupiter/jupitersession.cpp +++ b/src/zenremotestore/jupiter/jupitersession.cpp @@ -530,7 +530,7 @@ JupiterSession::PutMultipartBuildBlob(std::string_view Namespace, if (ValidateResult != CbValidateError::None) { JupiterResult Result = detail::ConvertResponse(StartMultipartResponse, "JupiterSession::PutMultipartBuildBlob"sv); - Result.ErrorCode = (int32)HttpResponseCode::UnsupportedMediaType; + Result.ErrorCode = (int32_t)HttpResponseCode::UnsupportedMediaType; Result.Reason = fmt::format("Invalid multipart response object format: '{}'", ToString(ValidateResult)); return Result; } diff --git a/src/zenserver/config/config.cpp b/src/zenserver/config/config.cpp index 70590b4e6..e7cfd490a 100644 --- a/src/zenserver/config/config.cpp +++ b/src/zenserver/config/config.cpp @@ -455,11 +455,13 @@ ZenServerConfiguratorBase::Configure(int argc, char* argv[]) exit(0); } +#if ZEN_WITH_TRACE if (!m_ServerOptions.HasTraceCommandlineOptions) { // Apply any Lua settings if we don't have them set from the command line TraceConfigure(m_ServerOptions.TraceOptions); } +#endif if (m_ServerOptions.QuietConsole) { diff --git a/src/zenserver/storage/projectstore/httpprojectstore.cpp b/src/zenserver/storage/projectstore/httpprojectstore.cpp index eef9fa7e6..8f2b9df9d 100644 --- a/src/zenserver/storage/projectstore/httpprojectstore.cpp +++ b/src/zenserver/storage/projectstore/httpprojectstore.cpp @@ -2035,14 +2035,14 @@ HttpProjectService::HandleOpLogEntriesRequest(HttpRouterRequest& Req) ProjectStore::Oplog::Paging EntryPaging; if (std::string_view Param = Params.GetValue("start"); !Param.empty()) { - if (auto Value = ParseInt<int32>(Param)) + if (auto Value = ParseInt<int32_t>(Param)) { EntryPaging.Start = *Value; } } if (std::string_view Param = Params.GetValue("count"); !Param.empty()) { - if (auto Value = ParseInt<int32>(Param)) + if (auto Value = ParseInt<int32_t>(Param)) { EntryPaging.Count = *Value; } diff --git a/src/zenstore/filecas.cpp b/src/zenstore/filecas.cpp index 13437369f..a895b81e0 100644 --- a/src/zenstore/filecas.cpp +++ b/src/zenstore/filecas.cpp @@ -261,7 +261,7 @@ FileCasStrategy::UpdateIndex(const IoHash& ChunkHash, uint64_t ChunkSize) { ZEN_MEMSCOPE(GetFileCasTag()); - uint64 OldChunkSize = 0; + uint64_t OldChunkSize = 0; { RwLock::ExclusiveLockScope _(m_Lock); if (auto It = m_Index.find(ChunkHash); It != m_Index.end()) @@ -347,7 +347,7 @@ FileCasStrategy::InsertChunk(IoBuffer Chunk, const IoHash& ChunkHash, CasStore:: // We moved the file, make sure the index reflects that { - uint64 OldChunkSize = (uint64)-1; + uint64_t OldChunkSize = (uint64_t)-1; { RwLock::ExclusiveLockScope _(m_Lock); if (auto It = m_Index.find(ChunkHash); It != m_Index.end()) @@ -356,7 +356,7 @@ FileCasStrategy::InsertChunk(IoBuffer Chunk, const IoHash& ChunkHash, CasStore:: m_Index.erase(It); } } - if (OldChunkSize != (uint64)-1) + if (OldChunkSize != (uint64_t)-1) { m_CasLog.Append({.Key = ChunkHash, .Flags = FileCasIndexEntry::kTombStone, .Size = OldChunkSize}); m_TotalSize.fetch_sub(OldChunkSize, std::memory_order::relaxed); @@ -429,7 +429,7 @@ FileCasStrategy::InsertChunk(IoBuffer Chunk, const IoHash& ChunkHash, CasStore:: } } const char* ChunkPath = nullptr; - uint64 ChunkSize = 0; + uint64_t ChunkSize = 0; int Fd; } PayloadFile = {.ChunkPath = ChunkPath.c_str(), .ChunkSize = ChunkSize, .Fd = Fd}; @@ -461,21 +461,21 @@ FileCasStrategy::InsertChunk(IoBuffer Chunk, const IoHash& ChunkHash, CasStore:: } IoBuffer -FileCasStrategy::SafeOpenChunk(const IoHash& ChunkHash, uint64 ExpectedSize) +FileCasStrategy::SafeOpenChunk(const IoHash& ChunkHash, uint64_t ExpectedSize) { ShardingHelper Name(m_RootDirectory, ChunkHash); const std::filesystem::path ChunkPath = Name.ShardedPath.ToPath(); RwLock::SharedLockScope ShardLock(LockForHash(ChunkHash)); if (IoBuffer Chunk = IoBufferBuilder::MakeFromFile(ChunkPath); Chunk) { - uint64 ChunkSize = Chunk.GetSize(); + uint64_t ChunkSize = Chunk.GetSize(); if (ChunkSize == ExpectedSize) { return Chunk; } - IoHash RawHash; - uint64 RawSize; + IoHash RawHash; + uint64_t RawSize; if (CompressedBuffer Compressed = CompressedBuffer::FromCompressed(SharedBuffer(Chunk), RawHash, RawSize); Compressed) { if (Compressed.GetCompressedSize() == ChunkSize) |