Skip to content

Commit

Permalink
pybind11, swig: C++ RAII
Browse files Browse the repository at this point in the history
  • Loading branch information
casperdcl committed Feb 26, 2024
1 parent 9281f74 commit 7f95eaf
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 7 deletions.
6 changes: 0 additions & 6 deletions cuvec/include/cuvec.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,6 @@ template <class T> struct NDCuVec {
if (size != vec.size()) throw std::length_error("reshape: size mismatch");
this->shape = shape;
}
~NDCuVec() {
vec.clear();
vec.shrink_to_fit();
shape.clear();
shape.shrink_to_fit();
}
};

#endif // _CUVEC_H_
1 change: 0 additions & 1 deletion cuvec/src/cuvec_swig.i
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ template <class T> NDCuVec<T> *NDCuVec_new(std::vector<size_t> shape) {
return self;
}
template <class T> void NDCuVec_del(NDCuVec<T> *self) {
self->~NDCuVec();
delete self;
}
template <class T> size_t NDCuVec_address(NDCuVec<T> *self) {
Expand Down

0 comments on commit 7f95eaf

Please sign in to comment.