PyCyBase 0.1.8.post4__cp313-cp313-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.
- cbase/__infra__.pxd +6 -0
- cbase/__init__.pxd +6 -0
- cbase/__init__.py +28 -0
- cbase/allocator_protocol/__infra__.pxd +58 -0
- cbase/allocator_protocol/__init__.pxd +58 -0
- cbase/allocator_protocol/__init__.py +45 -0
- cbase/allocator_protocol/c_allocator_protocol.c +31818 -0
- cbase/allocator_protocol/c_allocator_protocol.cp313-win_amd64.pyd +0 -0
- cbase/allocator_protocol/c_allocator_protocol.h +352 -0
- cbase/allocator_protocol/c_allocator_protocol.pxd +64 -0
- cbase/allocator_protocol/c_allocator_protocol.pyi +144 -0
- cbase/allocator_protocol/c_allocator_protocol.pyx +209 -0
- cbase/allocator_protocol/c_heap_allocator.c +38144 -0
- cbase/allocator_protocol/c_heap_allocator.cp313-win_amd64.pyd +0 -0
- cbase/allocator_protocol/c_heap_allocator.h +444 -0
- cbase/allocator_protocol/c_heap_allocator.pxd +97 -0
- cbase/allocator_protocol/c_heap_allocator.pyi +161 -0
- cbase/allocator_protocol/c_heap_allocator.pyx +300 -0
- cbase/allocator_protocol/c_nt_shm_allocator.c +33399 -0
- cbase/allocator_protocol/c_nt_shm_allocator.cp313-win_amd64.pyd +0 -0
- cbase/allocator_protocol/c_nt_shm_allocator.h +996 -0
- cbase/allocator_protocol/c_nt_shm_allocator.pxd +102 -0
- cbase/allocator_protocol/c_nt_shm_allocator.pyx +223 -0
- cbase/allocator_protocol/c_shm_allocator.h +1168 -0
- cbase/allocator_protocol/c_shm_allocator.pxd +142 -0
- cbase/allocator_protocol/c_shm_allocator.pyi +299 -0
- cbase/allocator_protocol/c_shm_allocator.pyx +442 -0
- cbase/allocator_protocol/c_shm_comp.c +4643 -0
- cbase/allocator_protocol/c_shm_comp.cp313-win_amd64.pyd +0 -0
- cbase/allocator_protocol/c_shm_comp.h +49 -0
- cbase/allocator_protocol/c_shm_comp.pxd +38 -0
- cbase/allocator_protocol/c_shm_comp.pyx +1 -0
- cbase/backports/__infra__.pxd +17 -0
- cbase/backports/__init__.pxd +17 -0
- cbase/backports/__init__.py +9 -0
- cbase/backports/pydict.h +55 -0
- cbase/backports/pydict.pxd +5 -0
- cbase/backports/pylong.c +9946 -0
- cbase/backports/pylong.cp313-win_amd64.pyd +0 -0
- cbase/backports/pylong.h +79 -0
- cbase/backports/pylong.pxd +23 -0
- cbase/backports/pylong.pyx +61 -0
- cbase/bytemap/__infra__.pxd +42 -0
- cbase/bytemap/__init__.pxd +42 -0
- cbase/bytemap/__init__.py +21 -0
- cbase/bytemap/c_bytemap.c +52076 -0
- cbase/bytemap/c_bytemap.cp313-win_amd64.pyd +0 -0
- cbase/bytemap/c_bytemap.h +867 -0
- cbase/bytemap/c_bytemap.pxd +370 -0
- cbase/bytemap/c_bytemap.pyx +1758 -0
- cbase/bytemap/xxh3.h +55 -0
- cbase/bytemap/xxhash.c +42 -0
- cbase/bytemap/xxhash.h +7487 -0
- cbase/env.c +11109 -0
- cbase/env.cp313-win_amd64.pyd +0 -0
- cbase/env.pxd +8 -0
- cbase/env.pyi +48 -0
- cbase/env.pyx +46 -0
- cbase/includes/cbase/allocator_protocol/c_allocator_protocol.c +31818 -0
- cbase/includes/cbase/allocator_protocol/c_allocator_protocol.h +352 -0
- cbase/includes/cbase/allocator_protocol/c_heap_allocator.c +38144 -0
- cbase/includes/cbase/allocator_protocol/c_heap_allocator.h +444 -0
- cbase/includes/cbase/allocator_protocol/c_nt_shm_allocator.c +33399 -0
- cbase/includes/cbase/allocator_protocol/c_nt_shm_allocator.h +996 -0
- cbase/includes/cbase/allocator_protocol/c_shm_allocator.h +1168 -0
- cbase/includes/cbase/allocator_protocol/c_shm_comp.c +4643 -0
- cbase/includes/cbase/allocator_protocol/c_shm_comp.h +49 -0
- cbase/includes/cbase/backports/pydict.h +55 -0
- cbase/includes/cbase/backports/pylong.c +9946 -0
- cbase/includes/cbase/backports/pylong.h +79 -0
- cbase/includes/cbase/bytemap/c_bytemap.c +52076 -0
- cbase/includes/cbase/bytemap/c_bytemap.h +867 -0
- cbase/includes/cbase/bytemap/xxh3.h +55 -0
- cbase/includes/cbase/bytemap/xxhash.c +42 -0
- cbase/includes/cbase/bytemap/xxhash.h +7487 -0
- cbase/includes/cbase/env.c +11109 -0
- cbase/includes/cbase/int128.h +81 -0
- cbase/includes/cbase/intern_string/c_intern_string.c +28081 -0
- cbase/includes/cbase/intern_string/c_intern_string.h +614 -0
- cbase/includes/cbase/nt/pthread_nt_compat.h +102 -0
- cbase/includes/cbase/nt/regex_nt_compat.h +133 -0
- cbase/includes/cbase/nt/time_sched_nt_compat.h +32 -0
- cbase/int128.h +81 -0
- cbase/int128.pxd +15 -0
- cbase/intern_string/BENCHMARK.md +157 -0
- cbase/intern_string/__infra__.pxd +11 -0
- cbase/intern_string/__init__.pxd +11 -0
- cbase/intern_string/__init__.py +19 -0
- cbase/intern_string/c_intern_string.c +28081 -0
- cbase/intern_string/c_intern_string.cp313-win_amd64.pyd +0 -0
- cbase/intern_string/c_intern_string.h +614 -0
- cbase/intern_string/c_intern_string.pxd +118 -0
- cbase/intern_string/c_intern_string.pyi +376 -0
- cbase/intern_string/c_intern_string.pyx +765 -0
- cbase/nt/pthread_nt_compat.h +102 -0
- cbase/nt/regex_nt_compat.h +133 -0
- cbase/nt/time_sched_nt_compat.h +32 -0
- pycybase-0.1.8.post4.dist-info/METADATA +180 -0
- pycybase-0.1.8.post4.dist-info/RECORD +101 -0
- pycybase-0.1.8.post4.dist-info/WHEEL +5 -0
- pycybase-0.1.8.post4.dist-info/top_level.txt +1 -0
cbase/__infra__.pxd
ADDED
cbase/__init__.pxd
ADDED
cbase/__init__.py
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
__version__ = '0.1.8.post4'
|
|
2
|
+
|
|
3
|
+
import functools
|
|
4
|
+
import os
|
|
5
|
+
import pathlib
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@functools.cache
|
|
9
|
+
def get_include() -> list[str]:
|
|
10
|
+
res_dir = pathlib.Path(__file__).parent
|
|
11
|
+
|
|
12
|
+
src_dirs = [
|
|
13
|
+
os.path.realpath(res_dir),
|
|
14
|
+
os.path.realpath(res_dir / 'allocator_protocol'),
|
|
15
|
+
os.path.realpath(res_dir / 'bytemap'),
|
|
16
|
+
os.path.realpath(res_dir / 'intern_string'),
|
|
17
|
+
]
|
|
18
|
+
|
|
19
|
+
include_root = os.path.realpath(res_dir / 'includes')
|
|
20
|
+
if os.path.isdir(include_root):
|
|
21
|
+
src_dirs.append(include_root)
|
|
22
|
+
|
|
23
|
+
return src_dirs
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
__all__ = [
|
|
27
|
+
'get_include',
|
|
28
|
+
]
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
from .c_allocator_protocol cimport (
|
|
2
|
+
AP_ALLOC_VIGILANT, AP_ALLOC_MAGIC,
|
|
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
|
+
|
|
29
|
+
heap_memory_block, heap_page, heap_allocator,
|
|
30
|
+
c_heap_page_roundup,
|
|
31
|
+
c_heap_block_roundup,
|
|
32
|
+
c_heap_page_reclaim,
|
|
33
|
+
|
|
34
|
+
c_heap_allocator_extend,
|
|
35
|
+
c_heap_allocator_new,
|
|
36
|
+
c_heap_allocator_free,
|
|
37
|
+
c_heap_calloc,
|
|
38
|
+
c_heap_request,
|
|
39
|
+
c_heap_free,
|
|
40
|
+
c_heap_reclaim,
|
|
41
|
+
|
|
42
|
+
HeapMemoryPage, HeapMemoryBlock, HeapAllocator, ALLOCATOR as HEAP_ALLOCATOR, C_ALLOCATOR as C_HEAP_ALLOCATOR
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
from .c_shm_comp cimport (
|
|
46
|
+
AP_SHM_AUTOPAGE_CAPACITY, AP_SHM_AUTOPAGE_CAPACITY_MAX, AP_SHM_AUTOPAGE_ALIGNMENT, AP_SHM_ALLOCATOR_PREFIX, AP_SHM_ALLOCATOR_DEFAULT_REGION_SIZE,
|
|
47
|
+
|
|
48
|
+
shm_allocator, shm_allocator_ctx,
|
|
49
|
+
|
|
50
|
+
c_shm_allocator_new,
|
|
51
|
+
c_shm_allocator_free,
|
|
52
|
+
c_shm_calloc,
|
|
53
|
+
c_shm_request,
|
|
54
|
+
c_shm_free,
|
|
55
|
+
c_shm_reclaim,
|
|
56
|
+
|
|
57
|
+
C_SHM_COMP
|
|
58
|
+
)
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
from .c_allocator_protocol cimport (
|
|
2
|
+
AP_ALLOC_VIGILANT, AP_ALLOC_MAGIC,
|
|
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
|
+
|
|
29
|
+
heap_memory_block, heap_page, heap_allocator,
|
|
30
|
+
c_heap_page_roundup,
|
|
31
|
+
c_heap_block_roundup,
|
|
32
|
+
c_heap_page_reclaim,
|
|
33
|
+
|
|
34
|
+
c_heap_allocator_extend,
|
|
35
|
+
c_heap_allocator_new,
|
|
36
|
+
c_heap_allocator_free,
|
|
37
|
+
c_heap_calloc,
|
|
38
|
+
c_heap_request,
|
|
39
|
+
c_heap_free,
|
|
40
|
+
c_heap_reclaim,
|
|
41
|
+
|
|
42
|
+
HeapMemoryPage, HeapMemoryBlock, HeapAllocator, ALLOCATOR as HEAP_ALLOCATOR, C_ALLOCATOR as C_HEAP_ALLOCATOR
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
from .c_shm_comp cimport (
|
|
46
|
+
AP_SHM_AUTOPAGE_CAPACITY, AP_SHM_AUTOPAGE_CAPACITY_MAX, AP_SHM_AUTOPAGE_ALIGNMENT, AP_SHM_ALLOCATOR_PREFIX, AP_SHM_ALLOCATOR_DEFAULT_REGION_SIZE,
|
|
47
|
+
|
|
48
|
+
shm_allocator, shm_allocator_ctx,
|
|
49
|
+
|
|
50
|
+
c_shm_allocator_new,
|
|
51
|
+
c_shm_allocator_free,
|
|
52
|
+
c_shm_calloc,
|
|
53
|
+
c_shm_request,
|
|
54
|
+
c_shm_free,
|
|
55
|
+
c_shm_reclaim,
|
|
56
|
+
|
|
57
|
+
C_SHM_COMP
|
|
58
|
+
)
|
|
@@ -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')
|