code-intelligence 3.3.1__py3-none-win_amd64.whl → 3.3.2__py3-none-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.
@@ -13,7 +13,7 @@ from .goober import (
13
13
  # SHAME - Bump when fixing things too embarrassing to admit.
14
14
  # PROUD.DEFAULT.SHAME
15
15
  # \ | /
16
- __version__ = "3.3.1"
16
+ __version__ = "3.3.2"
17
17
  __version_info__ = tuple(int(i) for i in __version__.split('.'))
18
18
 
19
19
  __all__ = [
@@ -50,12 +50,6 @@ _lib.get_pending_tasks_count.restype = C.c_uint64
50
50
  _lib.free_memory.argtypes = [C.c_void_p]
51
51
  _lib.free_memory.restype = None
52
52
 
53
- # --- CPYTHON C API ACCESS ---
54
- C.pythonapi.Py_IncRef.argtypes = [C.py_object]
55
- C.pythonapi.Py_IncRef.restype = None
56
- C.pythonapi.Py_DecRef.argtypes = [C.py_object]
57
- C.pythonapi.Py_DecRef.restype = None
58
-
59
53
 
60
54
  def positional_repr(cls):
61
55
  def __repr__(self):
@@ -77,26 +71,39 @@ class Definition_Link:
77
71
 
78
72
  # IMPORTANT: KEEP THIS ALIVE FOR GO THREAD WORKER
79
73
  C_NO_CALLBACK = SCAN_CALLBACK(0)
74
+ _KEEPALIVE = dict[int, tuple]()
80
75
 
81
76
 
82
77
  def _wrap_data_ptr(tup: tuple):
83
- # MANUALLY INCREMENT THE REFERENCE COUNT
84
- # We are now responsible for its lifetime
85
- C.pythonapi.Py_IncRef(C.py_object(tup))
86
-
87
- return id(tup) # C.cast(obj, C.c_void_p)
88
-
78
+ ptr = id(tup)
79
+ _KEEPALIVE[ptr] = tup
80
+ return ptr
89
81
 
90
- def _unwrap_data_ptr(data_ptr) -> tuple:
91
- assert data_ptr != 0, "we got NULL"
92
82
 
93
- tup = C.cast(data_ptr, C.py_object).value
83
+ def _unwrap_data_ptr(ptr) -> tuple:
84
+ tup = _KEEPALIVE.pop(ptr, None)
85
+ assert tup is not None, "keepalive missing for callback"
86
+ return tup
94
87
 
95
- # MANUALLY DECREMENT THE REFERENCE COUNT.
96
- # We are fulfilling our promise
97
- C.pythonapi.Py_DecRef(C.py_object(tup))
98
88
 
99
- return tup
89
+ # def _wrap_data_ptr(tup: tuple):
90
+ # # MANUALLY INCREMENT THE REFERENCE COUNT
91
+ # # We are now responsible for its lifetime
92
+ # C.pythonapi.Py_IncRef(C.py_object(tup))
93
+ #
94
+ # return id(tup) # C.cast(obj, C.c_void_p)
95
+ #
96
+ #
97
+ # def _unwrap_data_ptr(data_ptr) -> tuple:
98
+ # assert data_ptr != 0, "we got NULL"
99
+ #
100
+ # tup = C.cast(data_ptr, C.py_object).value
101
+ #
102
+ # # MANUALLY DECREMENT THE REFERENCE COUNT.
103
+ # # We are fulfilling our promise
104
+ # C.pythonapi.Py_DecRef(C.py_object(tup))
105
+ #
106
+ # return tup
100
107
 
101
108
 
102
109
  def scan_file(file, language: Language, callback=None, data=None) -> bool:
Binary file
@@ -1,4 +1,4 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: code_intelligence
3
- Version: 3.3.1
3
+ Version: 3.3.2
4
4
  Summary: Code intelligence library
@@ -0,0 +1,8 @@
1
+ code_intelligence-3.3.2.dist-info/METADATA,sha256=8CbUIUnddfvjcSVE89vgiuoqj4Rgsg6qLJSzxFdnwaI,100
2
+ code_intelligence-3.3.2.dist-info/RECORD,,
3
+ code_intelligence-3.3.2.dist-info/WHEEL,sha256=aD7J6E7Slys9i0J65v6Ehfi0DHYa5rImRhUDp62Iwh0,98
4
+ code_intelligence/__init__.py,sha256=OqMfhLblRbAVpTR0VKo2Ap-J4XKuDY-PaiqEv9N3zCU,587
5
+ code_intelligence/goober.py,sha256=CGwX8hulLbiJFx05u0hMYGXnbQnfYBmyyFildhj0ziQ,6622
6
+ code_intelligence/libcode_intelligence.h,sha256=9iy0xXcOpq366DuiKw1cw4-7VNz-QPAYBNJGZKEh12M,3169
7
+ code_intelligence/libcode_intelligence.so,sha256=Ls1qokhJ_5xlgUNDu4xBRjMeJIWL1ySiNz0yE_Pfh1w,2840576
8
+ code_intelligence/symdb.py,sha256=gRq3-xr2oYIzudgwDwMj3Zl5Pb0B8tDdnGKUB0WIV_o,32427
@@ -1,8 +0,0 @@
1
- code_intelligence-3.3.1.dist-info/METADATA,sha256=w-DvM6pR4uWVpKsguom5rlXqeWBYdtudT4Rrf5-_AFg,100
2
- code_intelligence-3.3.1.dist-info/RECORD,,
3
- code_intelligence-3.3.1.dist-info/WHEEL,sha256=aD7J6E7Slys9i0J65v6Ehfi0DHYa5rImRhUDp62Iwh0,98
4
- code_intelligence/__init__.py,sha256=iG0BcJz8lbGitiiOrnzZ7R9fIY9blHehoQ9Kmpu1PBw,587
5
- code_intelligence/goober.py,sha256=4MYEegk26-GfaOOsd8ufREYqFRq0nNmDs6jiBq-kD6s,6510
6
- code_intelligence/libcode_intelligence.h,sha256=9iy0xXcOpq366DuiKw1cw4-7VNz-QPAYBNJGZKEh12M,3169
7
- code_intelligence/libcode_intelligence.so,sha256=gbNPCTEzVkKwp1m7h16dQqyWvnhosxpXCWEUbRTqwh0,2840576
8
- code_intelligence/symdb.py,sha256=gRq3-xr2oYIzudgwDwMj3Zl5Pb0B8tDdnGKUB0WIV_o,32427