-
Notifications
You must be signed in to change notification settings - Fork 551
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
drt: Contiguous GC data #6016
base: master
Are you sure you want to change the base?
drt: Contiguous GC data #6016
Conversation
Signed-off-by: Krzysztof Bieganski <[email protected]>
Signed-off-by: Krzysztof Bieganski <[email protected]>
Signed-off-by: Krzysztof Bieganski <[email protected]>
Signed-off-by: Krzysztof Bieganski <[email protected]>
Signed-off-by: Krzysztof Bieganski <[email protected]>
Resizing these arrays could lead to dangling pointers and hard to find bugs. Signed-off-by: Krzysztof Bieganski <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
public: | ||
dynarray() = default; | ||
dynarray(std::vector<T>&& data) : data(std::move(data)) {} | ||
dynarray(size_t size) : data(size) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: unknown type name 'size_t'; did you mean 'std::size_t'? [clang-diagnostic-error]
dynarray(size_t size) : data(size) {} | |
dynarray(std::size_t size) : data(size) {} |
Additional context
/usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:279: 'std::size_t' declared here
typedef __SIZE_TYPE__ size_t;
^
dynarray() = default; | ||
dynarray(std::vector<T>&& data) : data(std::move(data)) {} | ||
dynarray(size_t size) : data(size) {} | ||
T& operator[](size_t idx) { return data[idx]; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: unknown type name 'size_t'; did you mean 'std::size_t'? [clang-diagnostic-error]
T& operator[](size_t idx) { return data[idx]; } | |
T& operator[](std::size_t idx) { return data[idx]; } |
Additional context
/usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:279: 'std::size_t' declared here
typedef __SIZE_TYPE__ size_t;
^
dynarray(std::vector<T>&& data) : data(std::move(data)) {} | ||
dynarray(size_t size) : data(size) {} | ||
T& operator[](size_t idx) { return data[idx]; } | ||
const T& operator[](size_t idx) const { return data[idx]; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: unknown type name 'size_t'; did you mean 'std::size_t'? [clang-diagnostic-error]
const T& operator[](size_t idx) const { return data[idx]; } | |
const T& operator[](std::size_t idx) const { return data[idx]; } |
Additional context
/usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:279: 'std::size_t' declared here
typedef __SIZE_TYPE__ size_t;
^
auto begin() const { return data.begin(); } | ||
auto end() { return data.end(); } | ||
auto end() const { return data.end(); } | ||
size_t size() const { return data.size(); } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: unknown type name 'size_t'; did you mean 'std::size_t'? [clang-diagnostic-error]
size_t size() const { return data.size(); } | |
std::size_t size() const { return data.size(); } |
Additional context
/usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:279: 'std::size_t' declared here
typedef __SIZE_TYPE__ size_t;
^
Store some of the GC data in contiguous arrays. The last commit is to ensure no one pushes to these vectors, as other code references this data via pointers, so we cannot invalidate them.
asap7/aes
drt-contiguous-gc
asap7/ibex
drt-contiguous-gc