diff options
author | dcs <dcs@FreeBSD.org> | 2001-05-29 23:44:12 +0000 |
---|---|---|
committer | dcs <dcs@FreeBSD.org> | 2001-05-29 23:44:12 +0000 |
commit | fa71f8751fbb427969b18b61043c195f43d52889 (patch) | |
tree | 5f557cd3117498b3d71c927f3918e44f58572bc3 /sys/boot/ficl | |
parent | 9a95925dcf710ae01a988bdba469d1b6cd91232e (diff) | |
download | FreeBSD-src-fa71f8751fbb427969b18b61043c195f43d52889.zip FreeBSD-src-fa71f8751fbb427969b18b61043c195f43d52889.tar.gz |
Turn dictthreshold and dictincrease into cell-sized variables, so
they can be used with cell operators like !.
As I did this, I noticed the whole CELL thing might have problems with
big endian architectures with sizeof(int)!=sizeof(void*).
Diffstat (limited to 'sys/boot/ficl')
-rw-r--r-- | sys/boot/ficl/dict.c | 11 | ||||
-rw-r--r-- | sys/boot/ficl/ficl.h | 4 |
2 files changed, 8 insertions, 7 deletions
diff --git a/sys/boot/ficl/dict.c b/sys/boot/ficl/dict.c index e5fdb2b..f5b9f15 100644 --- a/sys/boot/ficl/dict.c +++ b/sys/boot/ficl/dict.c @@ -66,8 +66,8 @@ #include "ficl.h" /* Dictionary on-demand resizing control variables */ -unsigned int dictThreshold; -unsigned int dictIncrease; +CELL dictThreshold; +CELL dictIncrease; static char *dictCopyName(FICL_DICT *pDict, STRINGINFO si); @@ -774,11 +774,12 @@ void hashReset(FICL_HASH *pHash) void dictCheckThreshold(FICL_DICT* dp) { - if( dictCellsAvail(dp) < dictThreshold ) { - dp->dict = ficlMalloc( dictIncrease * sizeof (CELL) ); + if( dictCellsAvail(dp) < dictThreshold.u ) { + dp->dict = ficlMalloc( dictIncrease.u * sizeof (CELL) ); assert(dp->dict); dp->here = dp->dict; - dp->size = dictIncrease; + dp->size = dictIncrease.u; + dictAlign(dp); } } diff --git a/sys/boot/ficl/ficl.h b/sys/boot/ficl/ficl.h index 057b08e..b0ee3b2 100644 --- a/sys/boot/ficl/ficl.h +++ b/sys/boot/ficl/ficl.h @@ -1011,8 +1011,8 @@ WORDKIND ficlWordClassify(FICL_WORD *pFW); /* ** Dictionary on-demand resizing */ -extern unsigned int dictThreshold; -extern unsigned int dictIncrease; +extern CELL dictThreshold; +extern CELL dictIncrease; /* ** Various FreeBSD goodies |