lib: fix two CURLDEBUG guards to be DEBUGBUILD#20328
lib: fix two CURLDEBUG guards to be DEBUGBUILD#20328vszakats wants to merge 1 commit intocurl:masterfrom
CURLDEBUG guards to be DEBUGBUILD#20328Conversation
Follow-up to df2b4cc curl#18157 Follow-up to 02e9690 curl#17015
|
I wonder if renaming New name could be Would this be desired and useful? |
CURLDEBUG is used for more than memdebug. I think the rename would be confusing. |
True, strictly speaking. It also tracks open/close and The feature is called "Track Memory" in public messages, also IMO What would be a better name? edit: |
|
What's |
|
I suspect that the source of the confusion is that we have two separate defines, and that all of us who ever debug curl have both set in debug builds. |
|
Merging edit2: also the reverse, someone may want to trace memory in a production build? Can't say how useful that is. Probably not very common because it's been untangled relatively recently and was broken earlier. Perhaps another data point is that memdebug is now (since 2025 autumn) "cleanly" implemented and unlikely to cause a build issue in any configuration. Meaning enabling it has no longer this potential drawback. edit: If merging, one way to go is remove build-level knobs, public facing separate "Track Memory" setting, and internally guard the few |
|
patch proposal: #20331 |
Drop separate `TrackMemory` (aka `CURLDEBUG`) debug feature. After recent changes (thread-safety, 193cb00, and updates leading up to it), `TrackMemory` is unlikely to cause build or runtime issues. To simplify builds and debug options, enable `TrackMemory` unconditionally for debug-enabled (aka `DEBUGBUILD`) builds. Before this patch, this was already the default, with an option to disable it, or enable it in non-debug-enabled builds. Note, in practice these two debug options already went hand in hand. It was not possible to toggle them separately for a long time due to bugs, before 59dc9f7 (2024-05-28) fixed it. This patch also removes/deprecates separate knobs and feature flags for `TrackMemory`: - autotools: `--enable-curldebug`/`--disable-curldebug` - cmake: `-DENABLE_CURLDEBUG=ON`/`OFF` - C macro: `CURLDEBUG` - libcurl: `CURL_VERSION_CURLDEBUG` symbol deprecated in favor of `CURL_VERSION_DEBUG`. They always return the same value after this patch. Also: - drop `TrackMemory` from `curl -V` output. - rename internal `CURLDEBUG` macro to `CURL_MEMDEBUG` internally. To avoid confusion with `DEBUGBUILD`, but to keep guarding `TrackMemory`-related internals for readability. - runtests: bind `TrackMemory` to debug feature. Keep it a separate test feature requirement, for clarity. - CI: drop test builds for combinations of the two options. - GHA/linux: no longer disable TrackMemory in the TSAN job. Ref: #20328 (comment) Closes #20331
Both guard the use of
CURL_DNS_SERVERdebug env.Follow-up to df2b4cc #18157
Follow-up to 02e9690 #17015
Follow-up to 59dc9f7 #13718