Files
typeshed/stdlib/multiprocessing/heap.pyi
Jelle Zijlstra bc463a0677 Remove default for size parameter to multiprocessing.heap.Heap (#9658)
It's system-dependent. stubdefaulter told me `multiprocessing.heap.Heap: parameter size: stub default 4096 != runtime default 16384`, which presumably means it's 4096 on @AlexWaygood's system and 16384 on mine. I looked in the code and the default is set to `mmap.PAGESIZE`, which in turn is set from some system call at import time.
2023-02-01 22:43:50 +00:00

37 lines
1.0 KiB
Python

import sys
from _typeshed import Incomplete
from collections.abc import Callable
from mmap import mmap
from typing import Protocol
from typing_extensions import TypeAlias
__all__ = ["BufferWrapper"]
class Arena:
size: int
buffer: mmap
if sys.platform == "win32":
name: str
def __init__(self, size: int) -> None: ...
else:
fd: int
def __init__(self, size: int, fd: int = -1) -> None: ...
_Block: TypeAlias = tuple[Arena, int, int]
if sys.platform != "win32":
class _SupportsDetach(Protocol):
def detach(self) -> int: ...
def reduce_arena(a: Arena) -> tuple[Callable[[int, _SupportsDetach], Arena], tuple[int, Incomplete]]: ...
def rebuild_arena(size: int, dupfd: _SupportsDetach) -> Arena: ...
class Heap:
def __init__(self, size: int = ...) -> None: ...
def free(self, block: _Block) -> None: ...
def malloc(self, size: int) -> _Block: ...
class BufferWrapper:
def __init__(self, size: int) -> None: ...
def create_memoryview(self) -> memoryview: ...