summaryrefslogtreecommitdiff
path: root/src/python/pybind11/core.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/python/pybind11/core.cc')
-rw-r--r--src/python/pybind11/core.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/python/pybind11/core.cc b/src/python/pybind11/core.cc
index a11ad7f6b..7ad45b408 100644
--- a/src/python/pybind11/core.cc
+++ b/src/python/pybind11/core.cc
@@ -46,6 +46,8 @@
#include "pybind11/pybind11.h"
+#include "python/pybind11/core.hh"
+
#include <ctime>
#include "base/addr_range.hh"
@@ -163,6 +165,10 @@ init_range(py::module &m_native)
.def("isSubset", &AddrRange::isSubset)
;
+ // We need to make vectors of AddrRange opaque to avoid a weird
+ // memory allocation issues in PyBind's STL wrappers.
+ py::bind_vector<std::vector<AddrRange>>(m, "AddrRangeVector");
+
m.def("RangeEx", &RangeEx);
m.def("RangeIn", &RangeIn);
m.def("RangeSize", &RangeSize);