Author: jplevyak
Date: Fri Nov 12 18:41:31 2010
New Revision: 1034505

URL: http://svn.apache.org/viewvc?rev=1034505&view=rev
Log:
Add back in documentation which was under #if 0

Modified:
    trafficserver/traffic/trunk/iocore/cache/P_CacheDir.h

Modified: trafficserver/traffic/trunk/iocore/cache/P_CacheDir.h
URL: 
http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cache/P_CacheDir.h?rev=1034505&r1=1034504&r2=1034505&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cache/P_CacheDir.h (original)
+++ trafficserver/traffic/trunk/iocore/cache/P_CacheDir.h Fri Nov 12 18:41:31 
2010
@@ -54,6 +54,7 @@ struct CacheVC;
 
 #define SYNC_MAX_WRITE                  (2 * 1024 * 1024)
 #define SYNC_DELAY                      HRTIME_MSECONDS(500)
+#define DO_NOT_REMOVE_THIS              0
 
 // Debugging Options
 
@@ -112,7 +113,6 @@ struct CacheVC;
 
 struct EvacuationBlock;
 typedef uint32 DirInfo;
-// Global Data
 
 // Cache Directory
 
@@ -124,16 +124,43 @@ typedef uint32 DirInfo;
 // on the processor.
 struct Dir
 {
+#if DO_NOT_REMOVE_THIS
+  // THE BIT-FIELD INTERPRETATION OF THIS STRUCT WHICH HAS TO 
+  // USE MACROS TO PREVENT UNALIGNED LOADS
+  // bits are numbered from lowest in u16 to highest
+  // always index as u16 to avoid byte order issues
+  unsigned int offset:24;       // (0,1:0-7) 16M * 512 = 8GB
+  unsigned int big:2;           // (1:8-9) 512 << (3 * big)
+  unsigned int size:6;          // (1:10-15) 6**2 = 64, 64*512 = 32768 .. 
64*256=16MB
+  unsigned int tag:12;          // (2:0-11) 2048 / 8 entries/bucket = .4%
+  unsigned int phase:1;         // (2:12)
+  unsigned int head:1;          // (2:13) first segment in a document
+  unsigned int pinned:1;        // (2:14)
+  unsigned int token:1;         // (2:15)
+  unsigned int next:16;         // (3)
+  inku16 offset_high;           // 8GB * 65k = 0.5PB (4)
+#else
   uint16 w[5];
   Dir() { dir_clear(this); }
+#endif
 };
 
 // INTERNAL: do not access these members directly, use the
 // accessors below (e.g. dir_offset, dir_set_offset)
 struct FreeDir
 {
+#if DO_NOT_REMOVE_THIS
+  // THE BIT-FIELD INTERPRETATION OF THIS STRUCT WHICH HAS TO 
+  // USE MACROS TO PREVENT UNALIGNED LOADS
+  unsigned int offset:24;       // 0: empty
+  unsigned int reserved:8;
+  unsigned int prev:16;         // (2)
+  unsigned int next:16;         // (3)
+  inku16 offset_high;           // 0: empty
+#else
   uint16 w[5];
   FreeDir() { dir_clear(this); }
+#endif
 };
 
 #define dir_bit(_e, _w, _b) ((uint32)(((_e)->w[_w] >> (_b)) & 1))


Reply via email to