This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Bug translator/6872] module cache cleaner


Hi -

This is looking better and better.  The code seems like it could go in
as it is right now, though I'd like to make (or see made) some minor
changes to it as style matters:

* The main.cxx code that runs get_cache_max() then clean_cache() could
  just go into cache.cxx:add_to_cache().

* Status messages could get printed in situ, rather than indirectly
  via returned result codes and then if/else checks.

* get_cache_max() could bypass the stringstream / getline business
  and just 
      std::ifstream foo ("cache_max_mb");
      unsigned num; foo >> num;
  You wouldn't need a separate function.  Plus, if merged with
  clean_cache(), you wouldn't need a new session variable either.

* Consider adding the cache_ent_info to a set<> (parametrized with the
  weight-comparer function for implicit sorting -- which should take
  const-refs by the way), rather than a vector<> that's later sorted.
  Then you get a sorted iteration later from begin()..end().


- FChE


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]