librdb icon indicating copy to clipboard operation
librdb copied to clipboard

Rename methods and members containing the reserved C++ delete keyword to destroy

Open sjperkins opened this issue 2 months ago • 3 comments

This is likely an API-breaking change

  • Closes #84

sjperkins avatar Nov 05 '25 08:11 sjperkins

Hi, I’m Jit, a friendly security platform designed to help developers build secure applications from day zero with an MVS (Minimal viable security) mindset.

In case there are security findings, they will be communicated to you as a comment inside the PR.

Hope you’ll enjoy using Jit.

Questions? Comments? Want to learn more? Get in touch with us.

jit-ci[bot] avatar Nov 05 '25 08:11 jit-ci[bot]

Hi @sjperkins, Thanks for the PR! I'd suggest

  • Using destroy instead of close for better semantic accuracy. This callback doesn't just close a handle it destroys the entire context (Closes file/socket handles, Frees memory, Complete cleanup with the option to reopen/reuse).
  • Maybe accordingly rename respFileWriteDelete to respFileWriteDestroy and redisLoaderDelete to redisLoaderDestroy.
  • Since this breaks the API, we need to bump the major version per semver. Bump src/version.h to 2.0.0.
  • We also need to add basic CHANGELOG.md. Something like:
## [2.0.0] - 2025-11-10

### Breaking Changes
- **RdbxRespWriter**: Renamed `delete` member to `destroy` for C++ compatibility
  - `delete` is a reserved keyword in C++
  - `destroy` more accurately describes the operation (cleanup + memory deallocation)
  • I also noticed that on version upgrade "make clean" won't del old generated libs. We probably need to refine src/lib/makefile and src/ext/makefile with:
@rm -rvf $(LIB_DIR)/lib$(LIB_NAME).so.* $(TARGET_LIB_STATIC) ./*.o ./*.d;

LMK, if you prefer i will do it. thanks.

moticless avatar Nov 10 '25 11:11 moticless

Hi @moticless. Apologies for the delayed response.

I believe I've addressed your comments. I'd appreciate a review of the changes.

sjperkins avatar Nov 26 '25 12:11 sjperkins