Skip to content
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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

kbieganski
Copy link
Contributor

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

Branch Min [s] Max [s] Mean [s] Relative mean Median [s] Relative median
baseline 400.30 401.20 400.77 ± 0.27 1.03 400.83 1.03
drt-contiguous-gc 390.57 390.82 390.66 ± 0.08 1.00 390.63 1.00

asap7/ibex

Branch Min [s] Max [s] Mean [s] Relative mean Median [s] Relative median
baseline 570.74 571.73 571.13 ± 0.31 1.03 571.08 1.03
drt-contiguous-gc 555.77 557.53 556.71 ± 0.50 1.00 556.69 1.00

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]>
Copy link
Contributor

@github-actions github-actions bot left a 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) {}
Copy link
Contributor

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]

Suggested change
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]; }
Copy link
Contributor

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]

Suggested change
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]; }
Copy link
Contributor

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]

Suggested change
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(); }
Copy link
Contributor

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]

Suggested change
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;
                         ^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant