/* sortlist */ extern List *sortlist(List *list) { if (length(list) > 1) { Vector *v = vectorize(list); sortvector(v); gcdisable(0); Ref(List *, lp, listify(v->count, v->vector)); gcenable(); list = lp; RefEnd(lp); }
extern Vector *mkenv(void) { if (isdirty || rebound) { env->count = envmin; gcdisable(); /* TODO: make this a good guess */ dictforall(vars, mkenv0, NULL); gcenable(); env->vector[env->count] = NULL; isdirty = FALSE; rebound = FALSE; if (sortenv == NULL || env->count > sortenv->alloclen) sortenv = mkvector(env->count * 2); sortenv->count = env->count; memcpy(sortenv->vector, env->vector, sizeof (char *) * (env->count + 1)); sortvector(sortenv); } return sortenv; }