Skip to content

Comments

Deprecate AllocatorMemoryStrategy, MemoryStrategy and remove related test cases#3082

Open
Scott-Duncan wants to merge 3 commits intoros2:rollingfrom
Scott-Duncan:deprecate_allocator_memory_strategy_and_tests
Open

Deprecate AllocatorMemoryStrategy, MemoryStrategy and remove related test cases#3082
Scott-Duncan wants to merge 3 commits intoros2:rollingfrom
Scott-Duncan:deprecate_allocator_memory_strategy_and_tests

Conversation

@Scott-Duncan
Copy link

Description

This PR implements the deprecation of AllocatorMemoryStrategy and the MemoryStrategy base class as discussed in #3049. All classes and methods are marked deprecated, the relevant tests test_allocator_memory_strategy.cpp, test_memory_strategy.cpp have been deleted and removed from the Testing CMakeLists.txt.

Fixes: #3049

Is this user-facing behavior change?

No.

Did you use Generative AI?

No.

Additional Information

Tested and compiled using the ros:rolling Docker image

Mark AllocatorMemoryStrategy as deprecated, as
they have become dead code following the double-buffering changes
in the executor.

- Add [[deprecated]] attributes to classes and methods.
- Add macros to silence test warnings

Signed-off-by: Scott Duncan <scott.duncan.work@gmail.com>
Mark MemoryStrategy as deprecated, as
they have become dead code following the double-buffering changes
in the executor.

- Add [[deprecated]] attributes to classes and methods.
- Deprecate memory_strategy member in ExecutorOptions.
- Add macros to silence warning with tests

Signed-off-by: Scott Duncan <scott.duncan.work@gmail.com>
Remove test_memory_strategy.cpp and test_allocator_memory_strategy.cpp
and update CMakeLists.txt. These tests are no longer required as
the target classes are deprecated and slated for removal.

Signed-off-by: Scott Duncan <scott.duncan.work@gmail.com>
@Scott-Duncan Scott-Duncan force-pushed the deprecate_allocator_memory_strategy_and_tests branch from eef8a81 to faf005f Compare February 23, 2026 15:47
Copy link
Collaborator

@jmachowinski jmachowinski left a comment

Choose a reason for hiding this comment

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

Only adding deprecation to the classes is enough.
The test must stay in place over the deprecation period, but should use

RCPPUTILS_DEPRECATION_WARNING_OFF_START
//test code with deprecation in it
RCPPUTILS_DEPRECATION_WARNING_OFF_STOP

to supress the compile warnings

Comment on lines +48 to +54
#if !defined(_WIN32)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#else // !defined(_WIN32)
#pragma warning(push)
#pragma warning(disable : 4996)
#endif
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is removing the deprecation warning, which defies the purpose.

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.

Deprecate AllocatorMemoryStrategy and remove related test cases

2 participants