phongn commented on code in PR #13233:
URL: https://github.com/apache/trafficserver/pull/13233#discussion_r3468442418


##########
src/iocore/cache/RamCacheCLFUS.cc:
##########
@@ -31,24 +31,22 @@
 #include "iocore/eventsystem/Tasks.h"
 #include "fastlz/fastlz.h"
 #include "tscore/CryptoHash.h"
+#include "tscore/Regression.h"
 #include <zlib.h>
 #ifdef HAVE_LZMA_H
 #include <lzma.h>
 #endif
 
-#define REQUIRED_COMPRESSION 0.9 // must get to this size or declared 
incompressible
-#define REQUIRED_SHRINK      0.8 // must get to this size or keep original 
buffer (with padding)
-#define HISTORY_HYSTERIA     10  // extra temporary history
-#define ENTRY_OVERHEAD       256 // per-entry overhead to consider when 
computing cache value/size
-#define LZMA_BASE_MEMLIMIT   (64 * 1024 * 1024)
 // #define CHECK_ACOUNTING 1 // very expensive double checking of all sizes
 
-#define REQUEUE_HITS(_h)              ((_h) ? ((_h) - 1) : 0)
-#define CACHE_VALUE_HITS_SIZE(_h, _s) (static_cast<float>(((_h) + 1) / ((_s) + 
ENTRY_OVERHEAD)))
-#define CACHE_VALUE(_x)               CACHE_VALUE_HITS_SIZE((_x)->hits, 
(_x)->size)
+constexpr float    required_compression = 0.9f;
+constexpr float    required_shrink      = 0.8f;

Review Comment:
   I'm not sure what I was thinking here, though I don't think the precision is 
particularly important. I reverted this back to `double`.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to