You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by "hnakamur (via GitHub)" <gi...@apache.org> on 2025/05/08 14:29:31 UTC
[PR] Cleanup: Just use vector for seen in RamCacheLRU [trafficserver]
hnakamur opened a new pull request, #12229:
URL: https://github.com/apache/trafficserver/pull/12229
(no comment)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Cleanup: Just use vector for seen in RamCacheLRU [trafficserver]
Posted by "JosiahWI (via GitHub)" <gi...@apache.org>.
JosiahWI commented on code in PR #12229:
URL: https://github.com/apache/trafficserver/pull/12229#discussion_r2081756548
##########
src/iocore/cache/RamCacheLRU.cc:
##########
@@ -54,7 +54,7 @@ struct RamCacheLRU : public RamCache {
void init(int64_t max_bytes, StripeSM *stripe) override;
// private
- std::vector<bool> *seen = nullptr;
+ std::vector<bool> seen{};
Review Comment:
The `{}` is actually redundant here, but doesn't hurt.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Cleanup: Just use vector for seen in RamCacheLRU [trafficserver]
Posted by "cmcfarlen (via GitHub)" <gi...@apache.org>.
cmcfarlen merged PR #12229:
URL: https://github.com/apache/trafficserver/pull/12229
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Cleanup: Just use vector for seen in RamCacheLRU [trafficserver]
Posted by "hnakamur (via GitHub)" <gi...@apache.org>.
hnakamur commented on code in PR #12229:
URL: https://github.com/apache/trafficserver/pull/12229#discussion_r2082075131
##########
src/iocore/cache/RamCacheLRU.cc:
##########
@@ -54,7 +54,7 @@ struct RamCacheLRU : public RamCache {
void init(int64_t max_bytes, StripeSM *stripe) override;
// private
- std::vector<bool> *seen = nullptr;
+ std::vector<bool> seen{};
Review Comment:
I removed `{}` at [0b4de59](https://github.com/apache/trafficserver/pull/12229/commits/0b4de5905caefe754f433476fdb3c39159057eb1).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Cleanup: Just use vector for seen in RamCacheLRU [trafficserver]
Posted by "JosiahWI (via GitHub)" <gi...@apache.org>.
JosiahWI commented on PR #12229:
URL: https://github.com/apache/trafficserver/pull/12229#issuecomment-2864054734
Why would someone do this in the first place? Some kind of oversight, maybe from a previous refactor?
The most interesting reason I've thought of so far to use `*std::vector<bool>` is to reduce the stack memory footprint of the containing structure. I don't think `RamCacheLRU` needs to have a low stack size though, right?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Cleanup: Just use vector for seen in RamCacheLRU [trafficserver]
Posted by "hnakamur (via GitHub)" <gi...@apache.org>.
hnakamur commented on PR #12229:
URL: https://github.com/apache/trafficserver/pull/12229#issuecomment-2865744478
The previous refactor was [Improve seen list for the RAM cache by zwoop · Pull Request #10662 · apache/trafficserver](https://github.com/apache/trafficserver/pull/10662).
Should I change the type of `seen` to `std::unique_ptr<std::vector<bool>>` as suggested at https://github.com/apache/trafficserver/pull/10662#discussion_r1406592391
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org