Skip to content

Refactor run_lcm_subproc by removing memory allocation with new/delete. - #93

Merged
Zhihua Lai (doctorlai-msrc) merged 2 commits into
devfrom
smartpointers
May 25, 2025
Merged

Zhihua Lai (doctorlai-msrc) merged 2 commits into
devfrom
smartpointers

Conversation

@doctorlai-msrc

@doctorlai-msrc Zhihua Lai (doctorlai-msrc) commented May 18, 2025 •

Copy link
Copy Markdown
Collaborator

This PR closes #92

We should almost never use "new " operator in CPP code. We should strive to use the smart pointers or simply not allocate memory to avoid memory leaks. This PR also refactors the function run_lcm_subproc as it appears in two places.

@doctorlai-msrc Zhihua Lai (doctorlai-msrc) changed the title Refactor by using Smart Pointers Refactor run_lcm_subproc by removing memory allocation with new/delete. May 18, 2025
@doctorlai-msrc
Zhihua Lai (doctorlai-msrc) marked this pull request as ready for review May 18, 2025 16:34
@doctorlai-msrc
Zhihua Lai (doctorlai-msrc) enabled auto-merge (squash) May 18, 2025 16:36
@doctorlai-msrc
Zhihua Lai (doctorlai-msrc) deleted the smartpointers branch May 25, 2025 21:28
Xenofon Foukas (xfoukas) added a commit that referenced this pull request Jun 2, 2025
* Add branch instructions in CONTRIBUTING.md and Update ADO pipeline triggers (#78)

* Add Github Action Pipeline and Fixed INITIALIZE_SUBMODULES (#64)

* Add Debug build configuration testing to CI pipeline (#57)

---------

Co-authored-by: Zhihua Lai <[email protected]>
Co-authored-by: Xenofon Foukas <[email protected]>

* Add helper function for fixed points (#71) (#85)

Co-authored-by: Zhihua Lai <[email protected]>

* Fixes for tests to pass when cmake build type is Release (#86)

This fixes issue #79. When the cmake build type is not defined it defaults to Release.
Given that the tests rely on assert() to pass, the PR also undefs NDEBUG in the release build flags to prevent the optimizer from removing the assert() calls.

* Improve Validation Error Messages in Linked Map (#82)

* Matt/dev: MAX_NUM_HOOKS to 128 (#91)

* Add helper function for fixed points (#71)

* Increase MAX_NUM_HOOKS from 64 to 128 (#90)

---------

Co-authored-by: Zhihua Lai <[email protected]>

* Refactor run_lcm_subproc by removing memory allocation with new/delete. (#93)

* Fix build/package error in ubuntu22.04 (#96)

* Add native support for ARM builds (#59)

---------

Co-authored-by: Zhihua Lai <[email protected]>
Co-authored-by: Xenofon Foukas <[email protected]>
Co-authored-by: Connor Settle <[email protected]>
Co-authored-by: Zhihua Lai <[email protected]>

* Bugfix: perf time measurement API with invalid times (#102)

* Bump ubpf to the latest version (#103)

* Matt/issue94 (#95)

* Remove ado correctness + move to cloud agents (#100)

* Sync dev with main (#105)

* Add helper function for fixed points (#71)

* Increase MAX_NUM_HOOKS from 64 to 128 (#90)


---------

Co-authored-by: Zhihua Lai <[email protected]>
Co-authored-by: matthewbalkwill <[email protected]>

---------

Co-authored-by: Zhihua Lai <[email protected]>
Co-authored-by: Xiaochuan Ye <[email protected]>
Co-authored-by: matthewbalkwill <[email protected]>
Co-authored-by: Anita Tenjarla <[email protected]>
Co-authored-by: Zhihua Lai <[email protected]>
Co-authored-by: Connor Settle <[email protected]>
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.

2 participants