We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1571abe commit 293bf98Copy full SHA for 293bf98
1 file changed
sqlitefts/tokenizer.py
@@ -26,15 +26,32 @@
26
except:
27
dll = ffi.dlopen(find_library("sqlite3"))
28
29
-if hasattr(sys, "getobjects"):
+if "t" in sys.abiflags:
30
+ ffi.cdef(
31
+ """
32
+typedef struct sqlite3 sqlite3;
33
+typedef struct {
34
+ uintptr_t ob_tid;
35
+ uint16_t _padding;
36
+ uint8_t ob_mutex;
37
+ uint8_t ob_gc_bits;
38
+ uint32_t ob_ref_local;
39
+ ssize_t ob_ref_shared;
40
+ void *ob_type;
41
+ sqlite3 *db;
42
+} PyObject;
43
+"""
44
+ )
45
+elif hasattr(sys, "getobjects"):
46
# for a python built with Py_TRACE_REFS
47
ffi.cdef(
48
"""
49
typedef struct sqlite3 sqlite3;
50
typedef struct {
- void *_ob_next;
- void *_ob_prev;
- size_t ob_refcnt;
51
+ union {
52
+ ssize_t ob_refcnt;
53
+ uint32_t ob_refcnt_split[2];
54
+ };
55
void *ob_type;
56
sqlite3 *db;
57
} PyObject;
0 commit comments