Skip to content

Commit 0c81b8f

Browse files
committed
remove unused function
1 parent e3f3231 commit 0c81b8f

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

atomic_ops.py

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -75,32 +75,6 @@ def get_size(reserved: int) -> int:
7575
return reserved & 0xFFFF
7676

7777

78-
def validate_shm_name(name: str) -> None:
79-
"""Validate shared memory name for platform compatibility.
80-
81-
macOS has a 31-character limit for POSIX shared memory names (including the leading /).
82-
This function checks the name length and raises ValueError if it exceeds the limit.
83-
84-
Args:
85-
name: Shared memory name (with or without leading /)
86-
87-
Raises:
88-
ValueError: If the name is too long for macOS
89-
90-
Example:
91-
>>> validate_shm_name("my_queue") # OK: 10 chars (becomes "/my_queue" = 10 chars)
92-
>>> validate_shm_name("a_very_long_shared_memory_name_that_exceeds_limit") # Raises ValueError on macOS
93-
"""
94-
# Add leading / if not present (POSIX requirement on Linux/macOS)
95-
if sys.platform != 'win32' and not name.startswith('/'):
96-
name = '/' + name
97-
98-
# Check macOS limit
99-
if sys.platform == 'darwin' and len(name) > 31:
100-
raise ValueError(f"Shared memory name '{name}' is {len(name)} characters, "
101-
f"but macOS has a 31-character limit. Please use a shorter name.")
102-
103-
10478
class MemoryOrder(IntEnum):
10579
"""Memory ordering constants matching C++ std::memory_order."""
10680
RELAXED = 0 # memory_order_relaxed

0 commit comments

Comments
 (0)