Skip to content

score/baselibs : lib memory migration phase 1#130

Open
KrishaDeshkool wants to merge 6 commits intoeclipse-score:mainfrom
KrishaDeshkool:memory-removal-v2
Open

score/baselibs : lib memory migration phase 1#130
KrishaDeshkool wants to merge 6 commits intoeclipse-score:mainfrom
KrishaDeshkool:memory-removal-v2

Conversation

@KrishaDeshkool
Copy link
Copy Markdown
Contributor

This PR deprecates all the targets in lib/memory/shared and it will be moved to com repo.
when users builds they would get the deprecation warning to move to com repo.

Note: This does not remove anything from the baselibs yet.

@github-actions
Copy link
Copy Markdown

The created documentation from the pull request is available at: docu-html

interprocess_notification in the same package is already public and
depends on interprocess_mutex, so the mutex is effectively accessible
transitively. Making it explicitly public enables cross-repo consumers
that need direct access to the mutex API.
string_literal, split_string_view, and string_comparison_adaptor have
nothing to do with shared memory — they're generic string helpers that
ended up in score/memory for historical reasons.

Moved to score/string/ with proper namespaces:
- score::memory::LazySplitStringView → score::string::LazySplitStringView
- score::memory::StringComparisonAdaptor → score::string::StringComparisonAdaptor

Old targets in score/memory/BUILD are now aliases with deprecation.
All consumers updated (json, log, tracing).
…/concurrency/atomic

atomic_indirector is a mockable indirection layer for std::atomic — it
has nothing to do with shared memory. Used by safecpp/safe_atomics,
mw/log/wait_free_stack, and tracing.

Moved to score/concurrency/atomic/ with proper namespace:
- score::memory::shared::AtomicIndirectorReal → score::concurrency::atomic::AtomicIndirectorReal
- score::memory::shared::AtomicMock → score::concurrency::atomic::AtomicMock

Old targets in score/memory/shared/BUILD are aliases to the new location.
All consumers updated (safecpp, log, tracing, memory_region_map).
detail::do_allocation_algorithm() is a pure math function (~5 lines,
just calls std::align). It lived in shared_memory_resource.h which
meant fake_memory_resources (test doubles) pulled in the entire SHM
syscall layer just to use this one function.

Extracted into score/memory/shared:allocation_algorithm with minimal
deps (only pointer_arithmetic_util). Updated fake_memory_resources
to depend on allocation_algorithm instead of shared_memory_resource.
:types was a grab-bag aggregate that bundled 10+ targets. Consumers
that only needed one or two were pulling in everything. This causes
duplicate symbols when communication has its own copy of these targets
and both get linked through transitive deps.

Replaced with specific targets each consumer actually uses:
- chunk_list: managed_memory_resource + vector
- flexible_circular_allocator: managed_memory_resource + offset_ptr
- interface_types: i_shared_memory_resource + managed_memory_resource
- container tests: managed_memory_resource + offset_ptr + polymorphic_offset_ptr_allocator

Also narrowed i_shared_memory_resource dep from :types to
:managed_memory_resource (only header it actually includes).
@KrishaDeshkool KrishaDeshkool changed the title score: lib memory migration phase 1 score/baselibs : lib memory migration phase 1 Mar 27, 2026
@KrishaDeshkool KrishaDeshkool marked this pull request as ready for review March 27, 2026 11:37
The canonical maintained copy of score/memory/shared now lives in the
communication repo. These targets are frozen — kept only for backward
compatibility with existing baselibs consumers (tracing, containers).

Every cc_library target now has a deprecation warning telling users
to migrate to @score_communication//score/memory/shared.

Also made user_permission, shared_memory_error, and
shared_memory_test_resources visibility public so communication can
alias them without cross-repo visibility issues.

See score/memory/shared/README.md for full migration context.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

1 participant