Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions lldb/bindings/python/python-typemaps.h

This file was deleted.

18 changes: 12 additions & 6 deletions lldb/bindings/python/python-typemaps.swig
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ AND call SWIG_fail at the same time, because it will result in a double free.

*/

%inline %{

#include "../bindings/python/python-typemaps.h"

%}

%typemap(in) char ** {
/* Check if is a list */
if (PythonList::Check($input)) {
Expand Down Expand Up @@ -640,6 +634,18 @@ template <> bool SetNumberFromPyObject<double>(double &number, PyObject *obj) {
//
// I've also moved the call to PyBuffer_Release to the end of the SWIG wrapper,
// doing it right away is not legal according to the python buffer protocol.
%inline %{
struct Py_buffer_RAII {
Py_buffer buffer = {};
Py_buffer_RAII(){};
Py_buffer &operator=(const Py_buffer_RAII &) = delete;
Py_buffer_RAII(const Py_buffer_RAII &) = delete;
~Py_buffer_RAII() {
if (buffer.obj)
PyBuffer_Release(&buffer);
}
};
%}

%define %pybuffer_mutable_binary(TYPEMAP, SIZE)
%typemap(in) (TYPEMAP, SIZE) (Py_buffer_RAII view) {
Expand Down
Loading