@@ -80,6 +80,7 @@ Required for some python modules"}
8080 :PyGILState_Ensure {:rettype :int32
8181 :requires-gil? false
8282 :doc " Ensure this thread owns the python GIL.
83+
8384Each call must be matched with PyGILState_Release" }
8485 :PyGILState_Check {:rettype :int32
8586 :requires-gil? false
@@ -291,7 +292,17 @@ Each call must be matched with PyGILState_Release"}
291292 })
292293
293294
294- (def python-lib-def* (delay (dt-ffi/define-library python-library-fns )))
295+ (def python-lib-def* (delay (dt-ffi/define-library
296+ python-library-fns
297+ [" _Py_NoneStruct"
298+ " _Py_FalseStruct"
299+ " _Py_TrueStruct"
300+ " PyType_Type"
301+ " PyExc_StopIteration"
302+ " PyRange_Type"
303+ " PyExc_Exception" ]
304+ nil
305+ )))
295306(defonce pyobject-struct-type*
296307 (delay (dt-struct/define-datatype!
297308 :pyobject [{:name :ob_refcnt :datatype (ffi-size-t/size-t-type )}
@@ -439,7 +450,7 @@ Each call must be matched with PyGILState_Release"}
439450
440451(defn- deref-ptr-ptr
441452 ^Pointer [^Pointer val]
442- (Pointer. (case (ffi-size-t/size -t-type )
453+ (Pointer. (case (ffi-size-t/offset -t-type )
443454 :int32 (.getInt (native-buffer/unsafe ) (.address val))
444455 :int64 (.getLong (native-buffer/unsafe ) (.address val)))))
445456
@@ -721,8 +732,8 @@ Each call must be matched with PyGILState_Release"}
721732(defn pystr->str
722733 ^String [pyobj]
723734 ; ;manually allocate/deallocate for speed; this gets called a lot
724- (let [size-obj (dt-ffi/make-ptr ( ffi-size-t/size-t-type ) 0 {:resource-type nil
725- :uninitialized? true })
735+ (let [size-obj (dt-ffi/make-ptr :pointer 0 {:resource-type nil
736+ :uninitialized? true })
726737 ^Pointer str-ptr (PyUnicode_AsUTF8AndSize pyobj size-obj)
727738 nbuf (native-buffer/wrap-address (.address str-ptr)
728739 (size-obj 0 )
0 commit comments