Re: making sdirno an int8_t

From: Duane Wessels <wessels@dont-contact.us>
Date: Wed, 2 Aug 2000 07:12:07 -0600

On Wed, 2 Aug 2000, Adrian Chadd wrote:

> > Remind me again, what was [is] wrong with the old method?
>
> Simply memory usage. We've just saved three bytes per storeEntry. Its not
> much, but its a start.

We must be talking about different things. The old method used
four fewer bytes per StoreEntry. For "MODIO" you made this change:

@@ -1325,12 +1319,14 @@ struct _StoreEntry {
     size_t swap_file_sz;
     u_short refcount;
     u_short flags;
- sfileno swap_file_number;
-#if HEAP_REPLACEMENT
- heap_node *node;
-#else
- dlink_node lru;
+ sdirno swap_dirn;
+ sfileno swap_filen;
+ union {
+#ifdef HEAP_REPLACEMENT
+ heap_node *node;
 #endif
+ dlink_node lru;
+ } repl;
     u_short lock_count; /* Assume < 65536! */
     mem_status_t mem_status:3;
     ping_status_t ping_status:3;

which increased StoreEntry by 4 octets. sfileno and sdirno are both
ints.

Before (i.e., 'the old way') they were combined into a single 4 octet
location where 'swap_filen' was the low 24 bits of swap_file_number and
'swap_dirn' was the high 8 bits..
Received on Wed Aug 02 2000 - 07:12:15 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:12:34 MST