Fix JSON handling copy vs. ref semantics by zwass · Pull Request #8738 · osquery/osquery
- Remove duplication in functions (add/addCopy were basically the same) - Fix addRef to actually reference the value (previously it was also copying) - Use addRef in some places (such as file carving) where it can save on allocations Verified by running allocations profile with Instruments on macOS and observing that with the changes addRef creates fewer allocations. There may be other places where addRef can be used, and there may be places where a pushRef could make sense. This PR aims to make the names at least consistent with the behaviors.
zwass
marked this pull request as ready for review
zwass
mentioned this pull request
zwass added a commit that referenced this pull request
Feb 19, 2026This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters