Skip to content

Commit

Permalink
Fix a memory leak (#2705)
Browse files Browse the repository at this point in the history
  • Loading branch information
st-pasha authored Oct 23, 2020
1 parent cfdaa47 commit e51be60
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ test:

# In order to run with Address Sanitizer:
# $ make asan
# $ DYLD_INSERT_LIBRARIES=/usr/local/opt/llvm/lib/clang/7.0.0/lib/darwin/libclang_rt.asan_osx_dynamic.dylib ASAN_OPTIONS=detect_leaks=1 python -m pytest
# $ DYLD_INSERT_LIBRARIES=/usr/local/opt/llvm/lib/clang/10.0.0/lib/darwin/libclang_rt.asan_osx_dynamic.dylib ASAN_OPTIONS=detect_leaks=1 python -m pytest
#
.PHONY: asan
asan:
Expand Down
3 changes: 3 additions & 0 deletions docs/releases/v1.0.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@
has reached its end of life on 2020-09-13 and will no longer be
supported. If you are still using Python 3.5, please consider upgrading.
[#2642]

-[fix] Fixed a memory leak when creating a large number of datatable
objects. [#2701]
2 changes: 1 addition & 1 deletion src/core/python/args.cc
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ VarArgsIterator VarArgsIterable::end() const {


VarKwdsIterator::VarKwdsIterator(const PKArgs& args, Py_ssize_t i0)
: parent(args), pos(i0), curr_value(py::robj(nullptr), py::robj(nullptr))
: parent(args), pos(i0)
{
if (parent.kwds_dict) {
advance();
Expand Down
2 changes: 2 additions & 0 deletions src/core/python/xobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,9 @@ template <typename T, void(T::*METH)()>
void _safe_dealloc(PyObject* self) noexcept {
auto cl = dt::CallLogger::dealloc(self);
try {
PyTypeObject* tp = Py_TYPE(self);
(static_cast<T*>(self)->*METH)();
tp->tp_free(self);
}
catch (const std::exception& e) {
exception_to_python(e);
Expand Down

0 comments on commit e51be60

Please sign in to comment.