mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-04 11:42:28 +00:00
Add fixes performance and static web server
This commit is contained in:
parent
b6793d42d5
commit
c45e46f871
108 changed files with 2927 additions and 819 deletions
|
@ -53,8 +53,7 @@ _executive:
|
|||
call _setstack
|
||||
mov %eax,%edi
|
||||
call exit
|
||||
9: .endfn _executive,weak,hidden
|
||||
|
||||
.endfn _executive,weak,hidden
|
||||
ud2
|
||||
|
||||
#ifdef __PG__
|
||||
|
|
|
@ -28,9 +28,9 @@
|
|||
*/
|
||||
void *_getstack(void) {
|
||||
char *p;
|
||||
p = mmap((char *)0x700000000000 - STACKSIZE, STACKSIZE,
|
||||
PROT_READ | PROT_WRITE, MAP_FIXED | MAP_PRIVATE | MAP_ANONYMOUS, -1,
|
||||
0);
|
||||
p = mmap((char *)0x700000000000 /* IMAGE_BASE_VIRTUAL */ - STACKSIZE,
|
||||
STACKSIZE, PROT_READ | PROT_WRITE,
|
||||
MAP_FIXED | MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
|
||||
if (p == MAP_FAILED) abort();
|
||||
return p + STACKSIZE;
|
||||
}
|
||||
|
|
|
@ -28,8 +28,11 @@
|
|||
*/
|
||||
bool isheap(void *p) {
|
||||
int x, i;
|
||||
#if 1
|
||||
register intptr_t rsp asm("rsp");
|
||||
if ((intptr_t)p >= rsp) return false;
|
||||
#endif
|
||||
if ((intptr_t)p <= (intptr_t)_end) return false;
|
||||
x = (intptr_t)p >> 16;
|
||||
i = FindMemoryInterval(&_mmi, x);
|
||||
return i < _mmi.i && x >= _mmi.p[i].x && x <= _mmi.p[i].y;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue