diff --git a/CHANGELOG.md b/CHANGELOG.md index d27c136a3..6da0abdca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ This document follows the conventions laid out in [Keep a CHANGELOG][]. ## [Unreleased][] ### Added +- Added Python 3 buffer api support and PyBuffer interface for fast byte and numpy array read/write ([#980][p980]) ### Changed - Drop support for Python 2, 3.4, and 3.5 @@ -51,7 +52,6 @@ This version improves performance on benchmarks significantly compared to 2.3. - Support for Python 3.8 - Codecs as the designated way to handle automatic conversions between .NET and Python types -- Added Python 3 buffer api support and PyBuffer interface for fast byte and numpy array read/write ([#980][p980]) ### Changed diff --git a/src/runtime/runtime.cs b/src/runtime/runtime.cs index 915e1db00..f00b18a68 100644 --- a/src/runtime/runtime.cs +++ b/src/runtime/runtime.cs @@ -1154,6 +1154,8 @@ internal static long PyObject_Size(IntPtr pointer) //==================================================================== // Python buffer API //==================================================================== + [DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl)] + internal static extern int PyObject_CheckBuffer(IntPtr obj); [DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl)] internal static extern int PyObject_GetBuffer(IntPtr exporter, ref Py_buffer view, int flags);