File tree Expand file tree Collapse file tree 1 file changed +21
-4
lines changed Expand file tree Collapse file tree 1 file changed +21
-4
lines changed Original file line number Diff line number Diff line change 26
26
except :
27
27
dll = ffi .dlopen (find_library ("sqlite3" ))
28
28
29
- if hasattr (sys , "getobjects" ):
29
+ 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" ):
30
46
# for a python built with Py_TRACE_REFS
31
47
ffi .cdef (
32
48
"""
33
49
typedef struct sqlite3 sqlite3;
34
50
typedef struct {
35
- void *_ob_next;
36
- void *_ob_prev;
37
- size_t ob_refcnt;
51
+ union {
52
+ ssize_t ob_refcnt;
53
+ uint32_t ob_refcnt_split[2];
54
+ };
38
55
void *ob_type;
39
56
sqlite3 *db;
40
57
} PyObject;
You can’t perform that action at this time.
0 commit comments