Give Emacs another performance boost

This commit is contained in:
Justine Tunney 2023-08-18 09:34:14 -07:00
parent 5b42c810a5
commit 9c7b81ee0f
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
30 changed files with 253 additions and 102 deletions

View file

@ -20,7 +20,7 @@
#include "libc/calls/calls.h"
#include "libc/dce.h"
#include "libc/fmt/conv.h"
#include "libc/intrin/_getauxval.internal.h"
#include "libc/intrin/getauxval.internal.h"
#include "libc/runtime/runtime.h"
#include "libc/sysv/consts/auxv.h"
@ -55,7 +55,7 @@ static dontinline int __clk_tck_init(void) {
x = -1;
}
} else {
x = _getauxval(AT_CLKTCK).value;
x = __getauxval(AT_CLKTCK).value;
}
if (x < 1) x = 100;
clk_tck = x;

View file

@ -25,8 +25,8 @@
#include "libc/fmt/conv.h"
#include "libc/fmt/itoa.h"
#include "libc/fmt/magnumstrs.internal.h"
#include "libc/intrin/_getenv.internal.h"
#include "libc/intrin/bits.h"
#include "libc/intrin/getenv.internal.h"
#include "libc/intrin/weaken.h"
#include "libc/macros.internal.h"
#include "libc/runtime/runtime.h"
@ -120,7 +120,7 @@ static int GetSignalByName(const char *s) {
static void PutEnv(char **p, const char *kv) {
struct Env e;
e = _getenv(p, kv);
e = __getenv(p, kv);
p[e.i] = kv;
if (!e.s) p[e.i + 1] = 0;
}
@ -128,7 +128,7 @@ static void PutEnv(char **p, const char *kv) {
static void UnsetEnv(char **p, const char *k) {
int i;
struct Env e;
if ((e = _getenv(p, k)).s) {
if ((e = __getenv(p, k)).s) {
p[e.i] = 0;
for (i = e.i + 1; p[i]; ++i) {
p[i - 1] = p[i];
@ -399,7 +399,7 @@ static int Read(void) {
static int Cd(void) {
const char *s;
if ((s = n > 1 ? args[1] : _getenv(envs, "HOME").s)) {
if ((s = n > 1 ? args[1] : __getenv(envs, "HOME").s)) {
if (!chdir(s)) {
return 0;
} else {
@ -776,7 +776,7 @@ static const char *GetVar(const char *key) {
FormatInt32(vbuf, geteuid());
return vbuf;
} else {
return _getenv(envs, key).s;
return __getenv(envs, key).s;
}
}

View file

@ -16,10 +16,8 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/dce.h"
#include "libc/intrin/atomic.h"
#include "libc/intrin/getenv.internal.h"
#include "libc/intrin/safemacros.internal.h"
#include "libc/intrin/strace.internal.h"
#include "libc/log/libfatal.internal.h"
#include "libc/runtime/internal.h"
#include "libc/runtime/runtime.h"
@ -30,7 +28,7 @@
textstartup int __strace_init(int argc, char **argv, char **envp, long *auxv) {
/* asan isn't initialized yet at runlevel 300 */
if (__intercept_flag(&argc, argv, "--strace") ||
__atoul(nulltoempty(__getenv(envp, "STRACE")))) {
__atoul(nulltoempty(__getenv(envp, "STRACE").s))) {
strace_enabled(+1);
}
return (__argc = argc);