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 <thechargingvolcano@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
tniessen authored and targos committed Oct 13, 2018
1 parent 05108eb commit 678019c
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 678019c

Please sign in to comment.