Browse Source

!3395 Remove crutch and fix memory leak

Merge pull request !3395 from Alexey_Shevlyakov/remove_windows_define
tags/v0.7.0-beta
mindspore-ci-bot Gitee 5 years ago
parent
commit
7ac8c2df8a
2 changed files with 3 additions and 8 deletions
  1. +1
    -8
      mindspore/ccsrc/minddata/dataset/engine/datasetops/dataset_op.cc
  2. +2
    -0
      mindspore/ccsrc/minddata/dataset/engine/opt/pass.h

+ 1
- 8
mindspore/ccsrc/minddata/dataset/engine/datasetops/dataset_op.cc View File

@@ -244,15 +244,8 @@ void DatasetOp::Print(std::ostream &out, bool show_all) const {

// Gets the next buffer from the given child
Status DatasetOp::GetNextBuffer(std::unique_ptr<DataBuffer> *p_buffer, int32_t worker_id, bool retry_if_eoe) {
#if defined(_WIN32) || defined(_WIN64)
RETURN_IF_NOT_OK(out_connector_->PopWithRetry(static_cast<int>(worker_id), p_buffer, retry_if_eoe));
#else
std::unique_ptr<DataBuffer> next_buff;
// pop is a blocked call and will throw an interruption if the whole group shuts down.
RETURN_IF_NOT_OK(out_connector_->PopWithRetry(static_cast<int>(worker_id), &next_buff, retry_if_eoe));

*p_buffer = std::move(next_buff);
#endif
RETURN_IF_NOT_OK(out_connector_->PopWithRetry(static_cast<int>(worker_id), p_buffer, retry_if_eoe));
return Status::OK();
}



+ 2
- 0
mindspore/ccsrc/minddata/dataset/engine/opt/pass.h View File

@@ -91,6 +91,8 @@ class Pass : public std::enable_shared_from_this<Pass> {
// @param tree - Pointer to the execution tree to be transformed.
// @param modified - Pointer to the modified flag,
virtual Status Run(ExecutionTree *tree, bool *modified) = 0;

virtual ~Pass() = default;
};

// TreePass is a basic Pass class which performs transformation on ExecutionTree directly.


Loading…
Cancel
Save