summaryrefslogtreecommitdiff
path: root/sys/uvm
diff options
context:
space:
mode:
authorOwain Ainsworth <oga@cvs.openbsd.org>2011-05-07 15:31:26 +0000
committerOwain Ainsworth <oga@cvs.openbsd.org>2011-05-07 15:31:26 +0000
commitaa312c4c79ac76ab0ab4cb33168b24644ff685b6 (patch)
tree190282c7e1d7fdc3103aad1295a724b24e6f2adc /sys/uvm
parentd880748ace992868d7de87446b3d35ce74e5ef6f (diff)
Uvm Anonymous Objects depending on size either use an array or a
hashtable to keep the list of swap slots in use in. Only one of these will be in use at any one tmie, so shave some bytes and make it a union. ok thib@
Diffstat (limited to 'sys/uvm')
-rw-r--r--sys/uvm/uvm_aobj.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/sys/uvm/uvm_aobj.c b/sys/uvm/uvm_aobj.c
index 87ab9fd7782..fdea6df5605 100644
--- a/sys/uvm/uvm_aobj.c
+++ b/sys/uvm/uvm_aobj.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_aobj.c,v 1.51 2010/07/02 02:08:53 syuu Exp $ */
+/* $OpenBSD: uvm_aobj.c,v 1.52 2011/05/07 15:31:25 oga Exp $ */
/* $NetBSD: uvm_aobj.c,v 1.39 2001/02/18 21:19:08 chs Exp $ */
/*
@@ -147,12 +147,16 @@ struct uvm_aobj {
struct uvm_object u_obj; /* has: lock, pgops, memt, #pages, #refs */
int u_pages; /* number of pages in entire object */
int u_flags; /* the flags (see uvm_aobj.h) */
- int *u_swslots; /* array of offset->swapslot mappings */
- /*
- * hashtable of offset->swapslot mappings
- * (u_swhash is an array of bucket heads)
- */
- struct uao_swhash *u_swhash;
+ /*
+ * Either an array or hashtable (array of bucket heads) of
+ * offset -> swapslot mappings for the aobj.
+ */
+#define u_swslots u_swap.slot_array
+#define u_swhash u_swap.slot_hash
+ union swslots {
+ int *slot_array;
+ struct uao_swhash *slot_hash;
+ } u_swap;
u_long u_swhashmask; /* mask for hashtable */
LIST_ENTRY(uvm_aobj) u_list; /* global list of aobjs */
};