Skip to content
Draft
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
2 changes: 2 additions & 0 deletions ddtrace/profiling/collector/_memalloc_heap.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
/*
How heap profiler sampling works:

to break build cache

This is mostly derived from
https://github.com/google/tcmalloc/blob/master/docs/sampling.md#detailed-treatment-of-weighting-weighting

Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,7 @@ def get_exts_for(name):
else:
debug_compile_args = []

memalloc_debug_compile_args = ["-g"]

if not IS_PYSTON:
ext_modules: t.List[t.Union[Extension, Cython.Distutils.Extension, RustExtension]] = [
Expand All @@ -886,12 +887,12 @@ def get_exts_for(name):
"ddtrace/profiling/collector/_memalloc_heap_map.c",
],
extra_compile_args=(
debug_compile_args
memalloc_debug_compile_args
# If NDEBUG is set, assert statements are compiled out. Make
# sure we explicitly set this for normal builds, and explicitly
# _unset_ it for debug builds in case the CFLAGS from sysconfig
# include -DNDEBUG
+ (["-DNDEBUG"] if not debug_compile_args else ["-UNDEBUG"])
+ (["-DNDEBUG"] if not memalloc_debug_compile_args else ["-UNDEBUG"])
+ ["-D_POSIX_C_SOURCE=200809L", "-std=c11"]
+ fast_build_args
if CURRENT_OS != "Windows"
Expand Down
Loading