dissolve the hashtab nonsense, ¾ is good, and mirkev will also use that
This commit is contained in:
parent
c6edd7ebe6
commit
67714b270a
23
main.c
23
main.c
@ -34,7 +34,7 @@
|
|||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
#endif
|
#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;
|
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 */
|
/* define built-in commands and see if we were called as one */
|
||||||
ktinit(APERM, &builtins,
|
ktinit(APERM, &builtins,
|
||||||
/* currently up to 50 builtins */
|
/* currently up to 50 builtins: 75% of 128 = 2^7 */
|
||||||
/* 80% of 64 = 2^6 */ 6, /* 66% of 128 = 2^7 */ 7);
|
7);
|
||||||
for (i = 0; mkshbuiltins[i].name != NULL; i++)
|
for (i = 0; mkshbuiltins[i].name != NULL; i++)
|
||||||
if (!strcmp(ccp, builtin(mkshbuiltins[i].name,
|
if (!strcmp(ccp, builtin(mkshbuiltins[i].name,
|
||||||
mkshbuiltins[i].func)))
|
mkshbuiltins[i].func)))
|
||||||
@ -267,10 +267,10 @@ main_init(int argc, const char *argv[], Source **sp, struct block **lp)
|
|||||||
coproc_init();
|
coproc_init();
|
||||||
|
|
||||||
/* set up variable and command dictionaries */
|
/* set up variable and command dictionaries */
|
||||||
ktinit(APERM, &taliases, 0, 0);
|
ktinit(APERM, &taliases, 0);
|
||||||
ktinit(APERM, &aliases, 0, 0);
|
ktinit(APERM, &aliases, 0);
|
||||||
#ifndef MKSH_NOPWNAM
|
#ifndef MKSH_NOPWNAM
|
||||||
ktinit(APERM, &homedirs, 0, 0);
|
ktinit(APERM, &homedirs, 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* define shell keywords */
|
/* define shell keywords */
|
||||||
@ -1598,13 +1598,8 @@ tgrow(struct table *tp)
|
|||||||
|
|
||||||
/* table can get very full when reaching its size limit */
|
/* table can get very full when reaching its size limit */
|
||||||
tp->nfree = (tp->tshift == 30) ? 0x3FFF0000UL :
|
tp->nfree = (tp->tshift == 30) ? 0x3FFF0000UL :
|
||||||
/* but otherwise, only 80% (MKSH_SMALL) or 66% (normal) */
|
/* but otherwise, only 75% */
|
||||||
#ifdef MKSH_SMALL
|
((i * 3) / 4);
|
||||||
((i * 4) / 5)
|
|
||||||
#else
|
|
||||||
((i * 2) / 3)
|
|
||||||
#endif
|
|
||||||
;
|
|
||||||
tp->tbls = ntblp;
|
tp->tbls = ntblp;
|
||||||
if (otblp == NULL)
|
if (otblp == NULL)
|
||||||
return;
|
return;
|
||||||
@ -1634,7 +1629,7 @@ tgrow(struct table *tp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ktinit_real(Area *ap, struct table *tp, uint8_t initshift)
|
ktinit(Area *ap, struct table *tp, uint8_t initshift)
|
||||||
{
|
{
|
||||||
tp->areap = ap;
|
tp->areap = ap;
|
||||||
tp->tbls = NULL;
|
tp->tbls = NULL;
|
||||||
|
9
sh.h
9
sh.h
@ -157,7 +157,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef EXTERN
|
#ifdef EXTERN
|
||||||
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.568 2012/06/28 20:17:37 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.569 2012/07/01 15:38:07 tg Exp $");
|
||||||
#endif
|
#endif
|
||||||
#define MKSH_VERSION "R40 2012/06/28"
|
#define MKSH_VERSION "R40 2012/06/28"
|
||||||
|
|
||||||
@ -1816,12 +1816,7 @@ void coproc_write_close(int);
|
|||||||
int coproc_getfd(int, const char **);
|
int coproc_getfd(int, const char **);
|
||||||
void coproc_cleanup(int);
|
void coproc_cleanup(int);
|
||||||
struct temp *maketemp(Area *, Temp_type, struct temp **);
|
struct temp *maketemp(Area *, Temp_type, struct temp **);
|
||||||
void ktinit_real(Area *, struct table *, uint8_t);
|
void ktinit(Area *, struct table *, uint8_t);
|
||||||
#ifdef MKSH_SMALL
|
|
||||||
#define ktinit(ap, tp, s80, s66) ktinit_real((ap), (tp), (s80))
|
|
||||||
#else
|
|
||||||
#define ktinit(ap, tp, s80, s66) ktinit_real((ap), (tp), (s66))
|
|
||||||
#endif
|
|
||||||
struct tbl *ktscan(struct table *, const char *, uint32_t, struct tbl ***);
|
struct tbl *ktscan(struct table *, const char *, uint32_t, struct tbl ***);
|
||||||
/* table, name (key) to search for, hash(n) */
|
/* table, name (key) to search for, hash(n) */
|
||||||
#define ktsearch(tp, s, h) ktscan((tp), (s), (h), NULL)
|
#define ktsearch(tp, s, h) ktscan((tp), (s), (h), NULL)
|
||||||
|
6
syn.c
6
syn.c
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
#include "sh.h"
|
#include "sh.h"
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/syn.c,v 1.76 2012/06/28 20:04:02 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/syn.c,v 1.77 2012/07/01 15:38:08 tg Exp $");
|
||||||
|
|
||||||
extern short subshell_nesting_level;
|
extern short subshell_nesting_level;
|
||||||
extern void yyskiputf8bom(void);
|
extern void yyskiputf8bom(void);
|
||||||
@ -810,8 +810,8 @@ initkeywords(void)
|
|||||||
struct tbl *p;
|
struct tbl *p;
|
||||||
|
|
||||||
ktinit(APERM, &keywords,
|
ktinit(APERM, &keywords,
|
||||||
/* currently 28 keywords */
|
/* currently 28 keywords: 75% of 64 = 2^6 */
|
||||||
/* 80% of 64 = 2^6 */ 6, /* 66% of 64 = 2^6 */ 6);
|
6);
|
||||||
for (tt = tokentab; tt->name; tt++) {
|
for (tt = tokentab; tt->name; tt++) {
|
||||||
if (tt->reserved) {
|
if (tt->reserved) {
|
||||||
p = ktenter(&keywords, tt->name, hash(tt->name));
|
p = ktenter(&keywords, tt->name, hash(tt->name));
|
||||||
|
10
var.c
10
var.c
@ -27,7 +27,7 @@
|
|||||||
#include <sys/sysctl.h>
|
#include <sys/sysctl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/var.c,v 1.151 2012/06/28 20:02:29 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/var.c,v 1.152 2012/07/01 15:38:09 tg Exp $");
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Variables
|
* Variables
|
||||||
@ -74,8 +74,8 @@ newblock(void)
|
|||||||
l->argv = e->loc->argv;
|
l->argv = e->loc->argv;
|
||||||
}
|
}
|
||||||
l->exit = l->error = NULL;
|
l->exit = l->error = NULL;
|
||||||
ktinit(&l->area, &l->vars, 0, 0);
|
ktinit(&l->area, &l->vars, 0);
|
||||||
ktinit(&l->area, &l->funs, 0, 0);
|
ktinit(&l->area, &l->funs, 0);
|
||||||
l->next = e->loc;
|
l->next = e->loc;
|
||||||
e->loc = l;
|
e->loc = l;
|
||||||
}
|
}
|
||||||
@ -130,8 +130,8 @@ initvar(void)
|
|||||||
struct tbl *tp;
|
struct tbl *tp;
|
||||||
|
|
||||||
ktinit(APERM, &specials,
|
ktinit(APERM, &specials,
|
||||||
/* currently 12 specials */
|
/* currently 12 specials: 75% of 16 = 2^4 */
|
||||||
/* 80% of 16 = 2^4 */ 4, /* 66% of 32 = 2^5 */ 5);
|
4);
|
||||||
while (i < V_MAX - 1) {
|
while (i < V_MAX - 1) {
|
||||||
tp = ktenter(&specials, initvar_names[i],
|
tp = ktenter(&specials, initvar_names[i],
|
||||||
hash(initvar_names[i]));
|
hash(initvar_names[i]));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user