Skip to content

refactor: replace NULL with nullptr.#1061

Merged
XuZhang99 merged 2 commits intojd-opensource:mainfrom
Dragonliu2018:lzl/refactor/prefer_nullptr
Mar 17, 2026
Merged

refactor: replace NULL with nullptr.#1061
XuZhang99 merged 2 commits intojd-opensource:mainfrom
Dragonliu2018:lzl/refactor/prefer_nullptr

Conversation

@Dragonliu2018
Copy link
Copy Markdown
Contributor

@Dragonliu2018 Dragonliu2018 commented Mar 15, 2026

Replace NULL with nullptr following "Effective Modern C++" Item 8 guidelines.

Item 8: Prefer nullptr to 0 and NULL.

@Dragonliu2018 Dragonliu2018 changed the title refactor: replace NULL/0 with nullptr. refactor: replace NULL with nullptr. Mar 15, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly replaces NULL and 0 with nullptr for better type safety in C++. While reviewing these changes, I discovered a critical bug in the ClosureGuard's default constructor. It fails to initialize all member function objects, which can lead to a crash at runtime. My review includes a specific comment with a suggested fix for this issue.

Comment thread xllm/core/util/closure_guard.h Outdated
@Dragonliu2018 Dragonliu2018 force-pushed the lzl/refactor/prefer_nullptr branch from 23780bb to ae39f4e Compare March 15, 2026 05:06
Comment thread xllm/c_api/internal/helper.cpp Outdated
Comment thread xllm/core/util/spin_rw_lock.h Outdated
RobbieLeung
RobbieLeung previously approved these changes Mar 16, 2026
@XuZhang99 XuZhang99 merged commit a4a42c2 into jd-opensource:main Mar 17, 2026
10 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants