Skip to content

Commit

Permalink
src: fix bug in MallocedBuffer constructor
Browse files Browse the repository at this point in the history
This should be a generic type even though we are
currently only using `char` as `T`.

PR-URL: #23434
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
tniessen authored and jasnell committed Oct 17, 2018
1 parent a83096a commit ecacf33
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ struct MallocedBuffer {

MallocedBuffer() : data(nullptr) {}
explicit MallocedBuffer(size_t size) : data(Malloc<T>(size)), size(size) {}
MallocedBuffer(char* data, size_t size) : data(data), size(size) {}
MallocedBuffer(T* data, size_t size) : data(data), size(size) {}
MallocedBuffer(MallocedBuffer&& other) : data(other.data), size(other.size) {
other.data = nullptr;
}
Expand Down

0 comments on commit ecacf33

Please sign in to comment.