Skip to content

Commit 12c6211

Browse files
committed
Revert default Syzygy max_fds to 128
Python's mmap.mmap() actually (unnecessarily, with regard to our use case) duplicates the file descriptor and keeps a copy around for the lifetime of the memory map.
1 parent 0392397 commit 12c6211

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

chess/syzygy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1483,7 +1483,7 @@ class Tablebase:
14831483
"""
14841484
Manages a collection of tablebase files for probing.
14851485
"""
1486-
def __init__(self, *, max_fds: Optional[int] = None, VariantBoard: Type[chess.Board] = chess.Board) -> None:
1486+
def __init__(self, *, max_fds: Optional[int] = 128, VariantBoard: Type[chess.Board] = chess.Board) -> None:
14871487
self.variant = VariantBoard
14881488

14891489
self.max_fds = max_fds
@@ -1963,7 +1963,7 @@ def __exit__(self, exc_type: Optional[Type[BaseException]], exc_value: Optional[
19631963
self.close()
19641964

19651965

1966-
def open_tablebase(directory: str, *, load_wdl: bool = True, load_dtz: bool = True, max_fds: Optional[int] = None, VariantBoard: Type[chess.Board] = chess.Board) -> Tablebase:
1966+
def open_tablebase(directory: str, *, load_wdl: bool = True, load_dtz: bool = True, max_fds: Optional[int] = 128, VariantBoard: Type[chess.Board] = chess.Board) -> Tablebase:
19671967
"""
19681968
Opens a collection of tables for probing. See
19691969
:class:`~chess.syzygy.Tablebase`.

0 commit comments

Comments
 (0)