Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better Support for Disabling Pool Allocations #4539

Merged
merged 1 commit into from
Sep 9, 2024
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
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ option(QUIC_BUILD_PERF "Builds the perf code" OFF)
option(QUIC_BUILD_SHARED "Builds msquic as a dynamic library" ON)
option(QUIC_ENABLE_LOGGING "Enables logging" OFF)
option(QUIC_ENABLE_SANITIZERS "Enables sanitizers" OFF)
option(QUIC_ENABLE_POOL_ALLOC "Enables pool allocations" ON)
option(QUIC_STATIC_LINK_CRT "Statically links the C runtime" ON)
option(QUIC_STATIC_LINK_PARTIAL_CRT "Statically links the compiler-specific portion of the C runtime" ON)
option(QUIC_UWP_BUILD "Build for UWP" OFF)
Expand Down Expand Up @@ -332,7 +333,7 @@ if(QUIC_HIGH_RES_TIMERS)
list(APPEND QUIC_COMMON_DEFINES QUIC_HIGH_RES_TIMERS=1)
endif()

if (QUIC_ENABLE_SANITIZERS)
if (QUIC_ENABLE_SANITIZERS OR NOT QUIC_ENABLE_POOL_ALLOC)
list(APPEND QUIC_COMMON_DEFINES DISABLE_CXPLAT_POOL=1)
endif()

Expand Down
4 changes: 4 additions & 0 deletions src/inc/quic_platform_posix.h
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,11 @@ typedef struct CXPLAT_POOL {

} CXPLAT_POOL;

#ifndef DISABLE_CXPLAT_POOL
#define CXPLAT_POOL_MAXIMUM_DEPTH 256 // Copied from EX_MAXIMUM_LOOKASIDE_DEPTH_BASE
#else
#define CXPLAT_POOL_MAXIMUM_DEPTH 0 // TODO - Optimize this scenario better
#endif

#if DEBUG
typedef struct CXPLAT_POOL_ENTRY {
Expand Down
2 changes: 1 addition & 1 deletion src/inc/quic_platform_winuser.h
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ typedef struct CXPLAT_POOL {
#define CXPLAT_POOL_MAXIMUM_DEPTH 0x4000 // 16384
#define CXPLAT_POOL_DEFAULT_MAX_DEPTH 256 // Copied from EX_MAXIMUM_LOOKASIDE_DEPTH_BASE
#else
#define CXPLAT_POOL_MAXIMUM_DEPTH 0
#define CXPLAT_POOL_MAXIMUM_DEPTH 0 // TODO - Optimize this scenario better
#define CXPLAT_POOL_DEFAULT_MAX_DEPTH 0
#endif

Expand Down
Loading