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

Empty functions #12

Closed
phprus opened this issue Jul 25, 2022 · 3 comments
Closed

Empty functions #12

phprus opened this issue Jul 25, 2022 · 3 comments

Comments

@phprus
Copy link
Contributor

phprus commented Jul 25, 2022

The header file phmap.hpp contains empty functions:

gtl/include/gtl/phmap.hpp

Lines 662 to 707 in 8471500

// ----------------------------------------------------------------------------
// I N F O Z S T U B S
// ----------------------------------------------------------------------------
struct HashtablezInfo
{
void PrepareForSampling() {}
};
inline void RecordRehashSlow(HashtablezInfo*, size_t ) {}
static inline void RecordInsertSlow(HashtablezInfo* , size_t, size_t ) {}
static inline void RecordEraseSlow(HashtablezInfo*) {}
static inline HashtablezInfo* SampleSlow(int64_t*) { return nullptr; }
static inline void UnsampleSlow(HashtablezInfo* ) {}
class HashtablezInfoHandle
{
public:
inline void RecordStorageChanged(size_t , size_t ) {}
inline void RecordRehash(size_t ) {}
inline void RecordInsert(size_t , size_t ) {}
inline void RecordErase() {}
friend inline void swap(HashtablezInfoHandle& ,
HashtablezInfoHandle& ) noexcept {}
};
static inline HashtablezInfoHandle Sample() { return HashtablezInfoHandle(); }
class HashtablezSampler
{
public:
// Returns a global Sampler.
static HashtablezSampler& Global() { static HashtablezSampler hzs; return hzs; }
HashtablezInfo* Register() { static HashtablezInfo info; return &info; }
void Unregister(HashtablezInfo* ) {}
using DisposeCallback = void (*)(const HashtablezInfo&);
DisposeCallback SetDisposeCallback(DisposeCallback ) { return nullptr; }
int64_t Iterate(const std::function<void(const HashtablezInfo& stack)>& ) { return 0; }
};
static inline void SetHashtablezEnabled(bool ) {}
static inline void SetHashtablezSampleParameter(int32_t ) {}
static inline void SetHashtablezMaxSamples(int32_t ) {}

Some of these functions are not used anywhere.

Please tell me, are these functions needed or can they be removed?

@greg7mdp
Copy link
Owner

They can probably be removed, as long as the ci runs fine. These were used for internal google tracking.

@greg7mdp
Copy link
Owner

You can submit a PR if you like, or I can just remove them myself, whatever you prefer.

@phprus
Copy link
Contributor Author

phprus commented Jul 25, 2022

@greg7mdp
PR: #13

@phprus phprus closed this as completed Jul 25, 2022
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

No branches or pull requests

2 participants