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
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
#ifndef C_CBASE_INT128_H
|
|
2
|
+
#define C_CBASE_INT128_H
|
|
3
|
+
|
|
4
|
+
#include <stdint.h>
|
|
5
|
+
#include <string.h>
|
|
6
|
+
|
|
7
|
+
#if defined(__SIZEOF_INT128__)
|
|
8
|
+
typedef __int128_t int128_t;
|
|
9
|
+
typedef __uint128_t uint128_t;
|
|
10
|
+
|
|
11
|
+
static const uint128_t UINT128_MAX = (((uint128_t) 1) << 127) * 2 - 1;
|
|
12
|
+
static const int128_t INT128_MAX = (int128_t) (UINT128_MAX >> 1);
|
|
13
|
+
static const int128_t INT128_MIN = -((int128_t) (UINT128_MAX)) - 1;
|
|
14
|
+
|
|
15
|
+
static inline int c_u128_cmp(const uint128_t v1, const uint128_t v2) {
|
|
16
|
+
if (v1 < v2) return -1;
|
|
17
|
+
if (v1 > v2) return 1;
|
|
18
|
+
return 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
static inline int c_i128_cmp(const int128_t v1, const int128_t v2) {
|
|
22
|
+
if (v1 < v2) return -1;
|
|
23
|
+
if (v1 > v2) return 1;
|
|
24
|
+
return 0;
|
|
25
|
+
}
|
|
26
|
+
#else
|
|
27
|
+
/**
|
|
28
|
+
* @brief MSVC has no native 128-bit integer -- emulate with a two-limb
|
|
29
|
+
* little-endian struct (memory layout identical to __uint128_t on
|
|
30
|
+
* x86-64, so 16-byte ID slots stay byte-compatible).
|
|
31
|
+
*
|
|
32
|
+
* The Cython boundary converts via int.to_bytes/from_bytes, so no 128-bit
|
|
33
|
+
* arithmetic is required -- only 16-byte round-trips and ordered comparison.
|
|
34
|
+
*/
|
|
35
|
+
typedef struct {
|
|
36
|
+
uint64_t lo;
|
|
37
|
+
int64_t hi;
|
|
38
|
+
} int128_t;
|
|
39
|
+
typedef struct {
|
|
40
|
+
uint64_t lo;
|
|
41
|
+
uint64_t hi;
|
|
42
|
+
} uint128_t;
|
|
43
|
+
|
|
44
|
+
static const uint128_t UINT128_MAX = {UINT64_MAX, UINT64_MAX};
|
|
45
|
+
static const int128_t INT128_MAX = {UINT64_MAX, INT64_MAX};
|
|
46
|
+
static const int128_t INT128_MIN = {0u, INT64_MIN};
|
|
47
|
+
|
|
48
|
+
static inline int c_u128_cmp(const uint128_t v1, const uint128_t v2) {
|
|
49
|
+
if (v1.hi != v2.hi) return v1.hi < v2.hi ? -1 : 1;
|
|
50
|
+
if (v1.lo != v2.lo) return v1.lo < v2.lo ? -1 : 1;
|
|
51
|
+
return 0;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
static inline int c_i128_cmp(const int128_t v1, const int128_t v2) {
|
|
55
|
+
if (v1.hi != v2.hi) return v1.hi < v2.hi ? -1 : 1;
|
|
56
|
+
if (v1.lo != v2.lo) return v1.lo < v2.lo ? -1 : 1;
|
|
57
|
+
return 0;
|
|
58
|
+
}
|
|
59
|
+
#endif
|
|
60
|
+
|
|
61
|
+
static inline void c_write_uint128(void* data, uint128_t value) {
|
|
62
|
+
memcpy(data, &value, sizeof(uint128_t));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
static inline uint128_t c_read_uint128(const void* data) {
|
|
66
|
+
uint128_t value;
|
|
67
|
+
memcpy(&value, data, sizeof(uint128_t));
|
|
68
|
+
return value;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
static inline void c_write_int128(void* data, int128_t value) {
|
|
72
|
+
memcpy(data, &value, sizeof(int128_t));
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
static inline int128_t c_read_int128(const void* data) {
|
|
76
|
+
int128_t value;
|
|
77
|
+
memcpy(&value, data, sizeof(int128_t));
|
|
78
|
+
return value;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
#endif // C_CBASE_INT128_H
|