dissolve the hashtab nonsense, ¾ is good, and mirkev will also use that

This commit is contained in:
tg
2012-07-01 15:38:09 +00:00
parent c6edd7ebe6
commit 67714b270a
4 changed files with 19 additions and 29 deletions

23
main.c
View File

@ -34,7 +34,7 @@
#include <locale.h>
#endif
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.224 2012/06/28 20:05:08 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.225 2012/07/01 15:38:06 tg Exp $");
extern char **environ;
@ -238,8 +238,8 @@ main_init(int argc, const char *argv[], Source **sp, struct block **lp)
/* define built-in commands and see if we were called as one */
ktinit(APERM, &builtins,
/* currently up to 50 builtins */
/* 80% of 64 = 2^6 */ 6, /* 66% of 128 = 2^7 */ 7);
/* currently up to 50 builtins: 75% of 128 = 2^7 */
7);
for (i = 0; mkshbuiltins[i].name != NULL; i++)
if (!strcmp(ccp, builtin(mkshbuiltins[i].name,
mkshbuiltins[i].func)))
@ -267,10 +267,10 @@ main_init(int argc, const char *argv[], Source **sp, struct block **lp)
coproc_init();
/* set up variable and command dictionaries */
ktinit(APERM, &taliases, 0, 0);
ktinit(APERM, &aliases, 0, 0);
ktinit(APERM, &taliases, 0);
ktinit(APERM, &aliases, 0);
#ifndef MKSH_NOPWNAM
ktinit(APERM, &homedirs, 0, 0);
ktinit(APERM, &homedirs, 0);
#endif
/* define shell keywords */
@ -1598,13 +1598,8 @@ tgrow(struct table *tp)
/* table can get very full when reaching its size limit */
tp->nfree = (tp->tshift == 30) ? 0x3FFF0000UL :
/* but otherwise, only 80% (MKSH_SMALL) or 66% (normal) */
#ifdef MKSH_SMALL
((i * 4) / 5)
#else
((i * 2) / 3)
#endif
;
/* but otherwise, only 75% */
((i * 3) / 4);
tp->tbls = ntblp;
if (otblp == NULL)
return;
@ -1634,7 +1629,7 @@ tgrow(struct table *tp)
}
void
ktinit_real(Area *ap, struct table *tp, uint8_t initshift)
ktinit(Area *ap, struct table *tp, uint8_t initshift)
{
tp->areap = ap;
tp->tbls = NULL;