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

Make the benchmark compile successfully by GCC #1

Merged
merged 2 commits into from
May 31, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion SIMDString.h
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ class
return append(c);
}
replace(pos - m_data, 0, 1, c);
return m_data + pos;
return pos;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pos here is an iterator (aka const char*), so it cannot be added to another const char* (m_data).

IMHO it is a logical error (and also a compile error).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been fixed as of 8495257

}

constexpr SIMDString& insert(const_iterator pos, std::initializer_list<value_type> ilist) {
Expand Down
1 change: 1 addition & 0 deletions benchmarks/benchmarks.h
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,7 @@ static void BM_Swap(benchmark::State& state)

////////////////////////////////////////////////////////////////////////////////////////
// This is where the benchmarks are programmatically registered .
template <typename Str>
void RegisterBenchmarks(const char* classname) {
linwansong marked this conversation as resolved.
Show resolved Hide resolved
// buffer for formatting the benchmark name string into RegisterBenchmark
char buffer[512];
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/main.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//#define TEST_EASTL
//#define TEST_FOLLY
#define TEST_G3D_ALLOC
//#define TEST_G3D_ALLOC
linwansong marked this conversation as resolved.
Show resolved Hide resolved


#include "SIMDString.h"
Expand All @@ -19,7 +19,7 @@
#endif


int main(int argc, const char* argv[]) {
int main(int argc, char* argv[]) {
// __VA_ARGS_ is necessary because type templating messes up Macro argument parsing
# define REGISTER_CLASS_BENCHMARKS(...) RegisterBenchmarks<__VA_ARGS__>(#__VA_ARGS__)

Expand Down