File tree Expand file tree Collapse file tree 1 file changed +0
-26
lines changed
Expand file tree Collapse file tree 1 file changed +0
-26
lines changed Original file line number Diff line number Diff 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-
10478class MemoryOrder (IntEnum ):
10579 """Memory ordering constants matching C++ std::memory_order."""
10680 RELAXED = 0 # memory_order_relaxed
You can’t perform that action at this time.
0 commit comments