summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBert Belder <bertbelder@gmail.com>2019-05-11 03:13:29 +0200
committerBert Belder <bertbelder@gmail.com>2019-05-11 03:13:29 +0200
commit369a7ec94e191e2f4f72a12c9a9c0d0cb464e0c5 (patch)
treedd7de9c9381d6eb02889848a5206850aa21519d3
parent1fc61f3b6a32d30d3667855c4b2e4457f309ac87 (diff)
core: make PinnedBuf::Raw -> PinnedBuf conversion actually a move
-rw-r--r--core/libdeno/api.cc2
-rw-r--r--core/libdeno/buffer.h10
2 files changed, 6 insertions, 6 deletions
diff --git a/core/libdeno/api.cc b/core/libdeno/api.cc
index 81add1d07..bcdf7131b 100644
--- a/core/libdeno/api.cc
+++ b/core/libdeno/api.cc
@@ -167,7 +167,7 @@ void deno_execute(Deno* d_, void* user_data, const char* js_filename,
void deno_pinned_buf_delete(deno_pinned_buf* buf) {
// The PinnedBuf destructor implicitly releases the ArrayBuffer reference.
- auto _ = deno::PinnedBuf(*buf);
+ auto _ = deno::PinnedBuf(buf);
}
void deno_respond(Deno* d_, void* user_data, deno_buf buf) {
diff --git a/core/libdeno/buffer.h b/core/libdeno/buffer.h
index 4b3587d2d..636c241b0 100644
--- a/core/libdeno/buffer.h
+++ b/core/libdeno/buffer.h
@@ -114,11 +114,11 @@ class PinnedBuf {
// This constructor recreates a PinnedBuf that has previously been converted
// to a PinnedBuf::Raw using the IntoRaw() method. This is a move operation;
// the Raw struct is emptied in the process.
- explicit PinnedBuf(Raw raw)
- : data_ptr_(raw.data_ptr), data_len_(raw.data_len), pin_(raw.pin) {
- raw.data_ptr = nullptr;
- raw.data_len = 0;
- raw.pin = nullptr;
+ explicit PinnedBuf(Raw* raw)
+ : data_ptr_(raw->data_ptr), data_len_(raw->data_len), pin_(raw->pin) {
+ raw->data_ptr = nullptr;
+ raw->data_len = 0;
+ raw->pin = nullptr;
}
// The IntoRaw() method converts the PinnedBuf to a PinnedBuf::Raw so it's