PyCyBase 0.1.10__cp315-cp315-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. cbase/__infra__.pxd +6 -0
  2. cbase/__init__.pxd +6 -0
  3. cbase/__init__.py +31 -0
  4. cbase/allocator_protocol/__infra__.pxd +65 -0
  5. cbase/allocator_protocol/__init__.pxd +65 -0
  6. cbase/allocator_protocol/__init__.py +45 -0
  7. cbase/allocator_protocol/c_allocator_protocol.c +31874 -0
  8. cbase/allocator_protocol/c_allocator_protocol.cp315-win_amd64.pyd +0 -0
  9. cbase/allocator_protocol/c_allocator_protocol.h +352 -0
  10. cbase/allocator_protocol/c_allocator_protocol.pxd +66 -0
  11. cbase/allocator_protocol/c_allocator_protocol.pyi +144 -0
  12. cbase/allocator_protocol/c_allocator_protocol.pyx +209 -0
  13. cbase/allocator_protocol/c_heap_allocator.c +38225 -0
  14. cbase/allocator_protocol/c_heap_allocator.cp315-win_amd64.pyd +0 -0
  15. cbase/allocator_protocol/c_heap_allocator.h +554 -0
  16. cbase/allocator_protocol/c_heap_allocator.pxd +105 -0
  17. cbase/allocator_protocol/c_heap_allocator.pyi +161 -0
  18. cbase/allocator_protocol/c_heap_allocator.pyx +303 -0
  19. cbase/allocator_protocol/c_nt_shm_allocator.c +33455 -0
  20. cbase/allocator_protocol/c_nt_shm_allocator.cp315-win_amd64.pyd +0 -0
  21. cbase/allocator_protocol/c_nt_shm_allocator.h +1105 -0
  22. cbase/allocator_protocol/c_nt_shm_allocator.pxd +110 -0
  23. cbase/allocator_protocol/c_nt_shm_allocator.pyx +223 -0
  24. cbase/allocator_protocol/c_shm_allocator.h +1270 -0
  25. cbase/allocator_protocol/c_shm_allocator.pxd +150 -0
  26. cbase/allocator_protocol/c_shm_allocator.pyi +299 -0
  27. cbase/allocator_protocol/c_shm_allocator.pyx +445 -0
  28. cbase/allocator_protocol/c_shm_comp.c +4654 -0
  29. cbase/allocator_protocol/c_shm_comp.cp315-win_amd64.pyd +0 -0
  30. cbase/allocator_protocol/c_shm_comp.h +49 -0
  31. cbase/allocator_protocol/c_shm_comp.pxd +46 -0
  32. cbase/allocator_protocol/c_shm_comp.pyx +1 -0
  33. cbase/backports/__infra__.pxd +17 -0
  34. cbase/backports/__init__.pxd +17 -0
  35. cbase/backports/__init__.py +9 -0
  36. cbase/backports/pydict.h +55 -0
  37. cbase/backports/pydict.pxd +5 -0
  38. cbase/backports/pylong.c +9965 -0
  39. cbase/backports/pylong.cp315-win_amd64.pyd +0 -0
  40. cbase/backports/pylong.h +79 -0
  41. cbase/backports/pylong.pxd +23 -0
  42. cbase/backports/pylong.pyx +61 -0
  43. cbase/bytemap/__infra__.pxd +42 -0
  44. cbase/bytemap/__init__.pxd +42 -0
  45. cbase/bytemap/__init__.py +21 -0
  46. cbase/bytemap/c_bytemap.c +52151 -0
  47. cbase/bytemap/c_bytemap.cp315-win_amd64.pyd +0 -0
  48. cbase/bytemap/c_bytemap.h +867 -0
  49. cbase/bytemap/c_bytemap.pxd +370 -0
  50. cbase/bytemap/c_bytemap.pyx +1760 -0
  51. cbase/bytemap/xxh3.h +55 -0
  52. cbase/bytemap/xxhash.c +42 -0
  53. cbase/bytemap/xxhash.h +7487 -0
  54. cbase/config_view.c +7253 -0
  55. cbase/config_view.cp315-win_amd64.pyd +0 -0
  56. cbase/config_view.pyx +85 -0
  57. cbase/env.c +11120 -0
  58. cbase/env.cp315-win_amd64.pyd +0 -0
  59. cbase/env.pxd +8 -0
  60. cbase/env.pyi +48 -0
  61. cbase/env.pyx +46 -0
  62. cbase/includes/cbase/allocator_protocol/c_allocator_protocol.c +31874 -0
  63. cbase/includes/cbase/allocator_protocol/c_allocator_protocol.h +352 -0
  64. cbase/includes/cbase/allocator_protocol/c_heap_allocator.c +38225 -0
  65. cbase/includes/cbase/allocator_protocol/c_heap_allocator.h +554 -0
  66. cbase/includes/cbase/allocator_protocol/c_nt_shm_allocator.c +33455 -0
  67. cbase/includes/cbase/allocator_protocol/c_nt_shm_allocator.h +1105 -0
  68. cbase/includes/cbase/allocator_protocol/c_shm_allocator.h +1270 -0
  69. cbase/includes/cbase/allocator_protocol/c_shm_comp.c +4654 -0
  70. cbase/includes/cbase/allocator_protocol/c_shm_comp.h +49 -0
  71. cbase/includes/cbase/backports/pydict.h +55 -0
  72. cbase/includes/cbase/backports/pylong.c +9965 -0
  73. cbase/includes/cbase/backports/pylong.h +79 -0
  74. cbase/includes/cbase/bytemap/c_bytemap.c +52151 -0
  75. cbase/includes/cbase/bytemap/c_bytemap.h +867 -0
  76. cbase/includes/cbase/bytemap/xxh3.h +55 -0
  77. cbase/includes/cbase/bytemap/xxhash.c +42 -0
  78. cbase/includes/cbase/bytemap/xxhash.h +7487 -0
  79. cbase/includes/cbase/config_view.c +7253 -0
  80. cbase/includes/cbase/env.c +11120 -0
  81. cbase/includes/cbase/int128.h +81 -0
  82. cbase/includes/cbase/intern_string/c_intern_string.c +28138 -0
  83. cbase/includes/cbase/intern_string/c_intern_string.h +614 -0
  84. cbase/includes/cbase/nt/pthread_nt_compat.h +102 -0
  85. cbase/includes/cbase/nt/regex_nt_compat.h +133 -0
  86. cbase/includes/cbase/nt/time_sched_nt_compat.h +32 -0
  87. cbase/int128.h +81 -0
  88. cbase/int128.pxd +15 -0
  89. cbase/intern_string/BENCHMARK.md +157 -0
  90. cbase/intern_string/__infra__.pxd +13 -0
  91. cbase/intern_string/__init__.pxd +13 -0
  92. cbase/intern_string/__init__.py +19 -0
  93. cbase/intern_string/c_intern_string.c +28138 -0
  94. cbase/intern_string/c_intern_string.cp315-win_amd64.pyd +0 -0
  95. cbase/intern_string/c_intern_string.h +614 -0
  96. cbase/intern_string/c_intern_string.pxd +121 -0
  97. cbase/intern_string/c_intern_string.pyi +376 -0
  98. cbase/intern_string/c_intern_string.pyx +765 -0
  99. cbase/nt/pthread_nt_compat.h +102 -0
  100. cbase/nt/regex_nt_compat.h +133 -0
  101. cbase/nt/time_sched_nt_compat.h +32 -0
  102. pycybase-0.1.10.dist-info/METADATA +190 -0
  103. pycybase-0.1.10.dist-info/RECORD +105 -0
  104. pycybase-0.1.10.dist-info/WHEEL +5 -0
  105. pycybase-0.1.10.dist-info/top_level.txt +1 -0
cbase/__infra__.pxd ADDED
@@ -0,0 +1,6 @@
1
+ from .env cimport *
2
+ from .int128 cimport *
3
+ from .allocator_protocol cimport *
4
+ from .backports cimport *
5
+ from .bytemap cimport *
6
+ from .intern_string cimport *
cbase/__init__.pxd ADDED
@@ -0,0 +1,6 @@
1
+ from .env cimport *
2
+ from .int128 cimport *
3
+ from .allocator_protocol cimport *
4
+ from .backports cimport *
5
+ from .bytemap cimport *
6
+ from .intern_string cimport *
cbase/__init__.py ADDED
@@ -0,0 +1,31 @@
1
+ __version__ = '0.1.10'
2
+
3
+ import functools
4
+ import os
5
+ import pathlib
6
+
7
+ from .config_view import CONFIG_VIEW
8
+
9
+
10
+ @functools.cache
11
+ def get_include() -> list[str]:
12
+ res_dir = pathlib.Path(__file__).parent
13
+
14
+ src_dirs = [
15
+ os.path.realpath(res_dir),
16
+ os.path.realpath(res_dir / 'allocator_protocol'),
17
+ os.path.realpath(res_dir / 'bytemap'),
18
+ os.path.realpath(res_dir / 'intern_string'),
19
+ ]
20
+
21
+ include_root = os.path.realpath(res_dir / 'includes')
22
+ if os.path.isdir(include_root):
23
+ src_dirs.append(include_root)
24
+
25
+ return src_dirs
26
+
27
+
28
+ __all__ = [
29
+ 'get_include',
30
+ 'CONFIG_VIEW',
31
+ ]
@@ -0,0 +1,65 @@
1
+ from .c_allocator_protocol cimport (
2
+ AP_ALLOC_VIGILANT, AP_ALLOC_MAGIC, AP_DEALLOC_MAGIC, AP_DECREF_AUTOFREE,
3
+
4
+ allocator_protocol,
5
+ c_ap_allocator_protocol_new,
6
+ c_ap_allocator_protocol_free,
7
+ c_ap_allocator_protocol_acquire_owner,
8
+ c_ap_allocator_protocol_release_owner,
9
+
10
+ c_ap_protocol_from_ptr,
11
+ c_ap_alloc,
12
+ c_ap_free,
13
+ c_ap_incref,
14
+ c_ap_decref,
15
+ c_ap_strdup,
16
+ c_ap_realloc,
17
+ c_ap_is_allocator_buf,
18
+
19
+ AP_ALLOC_WITH_LOCK, AP_ALLOC_WITH_SHM, AP_ALLOC_WITH_FREELIST,
20
+ EnvConfigContext, AllocatorConfigContext,
21
+ AP_SHARED, AP_LOCKED, AP_LOCKFREE, AP_FREELIST,
22
+ AllocatorProtocol,
23
+ AP_DEFAULT_ALLOCATOR, AP_SHM_ALLOCATOR, AP_HEAP_ALLOCATOR
24
+ )
25
+
26
+ from .c_heap_allocator cimport (
27
+ AP_HEAP_AUTOPAGE_CAPACITY, AP_HEAP_AUTOPAGE_CAPACITY_MAX, AP_HEAP_AUTOPAGE_ALIGNMENT,
28
+ AP_HEAP_EXACT_BIN_COUNT, AP_HEAP_LARGE_BIN_COUNT, AP_HEAP_BIN_COUNT,
29
+ AP_HEAP_PAGE_EXTEND_MAX, AP_HEAP_PAGE_FIT_TO_REQUEST, AP_HEAP_EXACT_BIN_PROBE_COUNT,
30
+
31
+ heap_memory_block, heap_page, heap_allocator,
32
+ c_heap_page_roundup,
33
+ c_heap_block_roundup,
34
+ c_heap_block_ceil_log2,
35
+ c_heap_block_bin,
36
+ c_heap_page_reclaim,
37
+
38
+ c_heap_allocator_extend,
39
+ c_heap_allocator_new,
40
+ c_heap_allocator_free,
41
+ c_heap_calloc,
42
+ c_heap_request,
43
+ c_heap_free,
44
+ c_heap_reclaim,
45
+
46
+ HeapMemoryPage, HeapMemoryBlock, HeapAllocator, ALLOCATOR as HEAP_ALLOCATOR, C_ALLOCATOR as C_HEAP_ALLOCATOR
47
+ )
48
+
49
+ from .c_shm_comp cimport (
50
+ AP_SHM_AUTOPAGE_CAPACITY, AP_SHM_AUTOPAGE_CAPACITY_MAX, AP_SHM_AUTOPAGE_ALIGNMENT, AP_SHM_ALLOCATOR_PREFIX, AP_SHM_ALLOCATOR_DEFAULT_REGION_SIZE,
51
+ AP_SHM_NAME_LEN, AP_SHM_PREFIX_MAX,
52
+ AP_SHM_EXACT_BIN_COUNT, AP_SHM_LARGE_BIN_COUNT, AP_SHM_BIN_COUNT,
53
+ AP_SHM_PAGE_EXTEND_MAX, AP_SHM_PAGE_FIT_TO_REQUEST, AP_SHM_EXACT_BIN_PROBE_COUNT,
54
+
55
+ shm_allocator, shm_allocator_ctx,
56
+
57
+ c_shm_allocator_new,
58
+ c_shm_allocator_free,
59
+ c_shm_calloc,
60
+ c_shm_request,
61
+ c_shm_free,
62
+ c_shm_reclaim,
63
+
64
+ C_SHM_COMP
65
+ )
@@ -0,0 +1,65 @@
1
+ from .c_allocator_protocol cimport (
2
+ AP_ALLOC_VIGILANT, AP_ALLOC_MAGIC, AP_DEALLOC_MAGIC, AP_DECREF_AUTOFREE,
3
+
4
+ allocator_protocol,
5
+ c_ap_allocator_protocol_new,
6
+ c_ap_allocator_protocol_free,
7
+ c_ap_allocator_protocol_acquire_owner,
8
+ c_ap_allocator_protocol_release_owner,
9
+
10
+ c_ap_protocol_from_ptr,
11
+ c_ap_alloc,
12
+ c_ap_free,
13
+ c_ap_incref,
14
+ c_ap_decref,
15
+ c_ap_strdup,
16
+ c_ap_realloc,
17
+ c_ap_is_allocator_buf,
18
+
19
+ AP_ALLOC_WITH_LOCK, AP_ALLOC_WITH_SHM, AP_ALLOC_WITH_FREELIST,
20
+ EnvConfigContext, AllocatorConfigContext,
21
+ AP_SHARED, AP_LOCKED, AP_LOCKFREE, AP_FREELIST,
22
+ AllocatorProtocol,
23
+ AP_DEFAULT_ALLOCATOR, AP_SHM_ALLOCATOR, AP_HEAP_ALLOCATOR
24
+ )
25
+
26
+ from .c_heap_allocator cimport (
27
+ AP_HEAP_AUTOPAGE_CAPACITY, AP_HEAP_AUTOPAGE_CAPACITY_MAX, AP_HEAP_AUTOPAGE_ALIGNMENT,
28
+ AP_HEAP_EXACT_BIN_COUNT, AP_HEAP_LARGE_BIN_COUNT, AP_HEAP_BIN_COUNT,
29
+ AP_HEAP_PAGE_EXTEND_MAX, AP_HEAP_PAGE_FIT_TO_REQUEST, AP_HEAP_EXACT_BIN_PROBE_COUNT,
30
+
31
+ heap_memory_block, heap_page, heap_allocator,
32
+ c_heap_page_roundup,
33
+ c_heap_block_roundup,
34
+ c_heap_block_ceil_log2,
35
+ c_heap_block_bin,
36
+ c_heap_page_reclaim,
37
+
38
+ c_heap_allocator_extend,
39
+ c_heap_allocator_new,
40
+ c_heap_allocator_free,
41
+ c_heap_calloc,
42
+ c_heap_request,
43
+ c_heap_free,
44
+ c_heap_reclaim,
45
+
46
+ HeapMemoryPage, HeapMemoryBlock, HeapAllocator, ALLOCATOR as HEAP_ALLOCATOR, C_ALLOCATOR as C_HEAP_ALLOCATOR
47
+ )
48
+
49
+ from .c_shm_comp cimport (
50
+ AP_SHM_AUTOPAGE_CAPACITY, AP_SHM_AUTOPAGE_CAPACITY_MAX, AP_SHM_AUTOPAGE_ALIGNMENT, AP_SHM_ALLOCATOR_PREFIX, AP_SHM_ALLOCATOR_DEFAULT_REGION_SIZE,
51
+ AP_SHM_NAME_LEN, AP_SHM_PREFIX_MAX,
52
+ AP_SHM_EXACT_BIN_COUNT, AP_SHM_LARGE_BIN_COUNT, AP_SHM_BIN_COUNT,
53
+ AP_SHM_PAGE_EXTEND_MAX, AP_SHM_PAGE_FIT_TO_REQUEST, AP_SHM_EXACT_BIN_PROBE_COUNT,
54
+
55
+ shm_allocator, shm_allocator_ctx,
56
+
57
+ c_shm_allocator_new,
58
+ c_shm_allocator_free,
59
+ c_shm_calloc,
60
+ c_shm_request,
61
+ c_shm_free,
62
+ c_shm_reclaim,
63
+
64
+ C_SHM_COMP
65
+ )
@@ -0,0 +1,45 @@
1
+ import sys
2
+
3
+ from .c_heap_allocator import (
4
+ ALLOCATOR as HEAP_ALLOCATOR,
5
+ HeapAllocator,
6
+ HeapMemoryBlock,
7
+ HeapMemoryPage
8
+ )
9
+
10
+ if sys.platform == "win32":
11
+ from .c_nt_shm_allocator import (
12
+ NtSharedMemoryAllocator,
13
+ )
14
+ SHM_ALLOCATOR = None
15
+ SharedMemoryAllocator = NtSharedMemoryAllocator # alias for compat
16
+ SharedMemoryBlock = None # not implemented in NT wrapper
17
+ SharedMemoryPage = None # not implemented in NT wrapper
18
+ def shm_cleanup():
19
+ pass
20
+ else:
21
+ from .c_shm_allocator import (
22
+ ALLOCATOR as SHM_ALLOCATOR,
23
+ SharedMemoryAllocator,
24
+ SharedMemoryBlock,
25
+ SharedMemoryPage,
26
+ cleanup as shm_cleanup
27
+ )
28
+
29
+ from .c_allocator_protocol import (
30
+ AllocatorProtocol,
31
+ AP_FREELIST,
32
+ AP_LOCKED,
33
+ AP_LOCKFREE,
34
+ AP_SHARED,
35
+ AllocatorConfigContext,
36
+ )
37
+
38
+ __all__ = [
39
+ 'HEAP_ALLOCATOR', 'HeapAllocator', 'HeapMemoryBlock', 'HeapMemoryPage',
40
+ 'SHM_ALLOCATOR', 'SharedMemoryAllocator', 'SharedMemoryBlock', 'SharedMemoryPage', 'shm_cleanup',
41
+ 'AllocatorProtocol', 'AP_FREELIST', 'AP_LOCKED', 'AP_LOCKFREE', 'AP_SHARED', 'AllocatorConfigContext'
42
+ ]
43
+
44
+ if sys.platform == "win32":
45
+ __all__.append('NtSharedMemoryAllocator')