mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-08 12:18:31 +00:00
Iterate more on recent changes
This commit is contained in:
parent
7138399f96
commit
d0ad2694ed
22 changed files with 90 additions and 158 deletions
|
@ -41,6 +41,8 @@ static const char *GetFrameName(int x) {
|
|||
return "stack";
|
||||
} else if (IsGfdsFrame(x)) {
|
||||
return "g_fds";
|
||||
} else if (IsNsyncFrame(x)) {
|
||||
return "nsync";
|
||||
} else if (IsZiposFrame(x)) {
|
||||
return "zipos";
|
||||
} else if (IsMemtrackFrame(x)) {
|
||||
|
|
|
@ -44,11 +44,9 @@ static void *_mapframe_impl(void *p, int f) {
|
|||
if (!rc) {
|
||||
return p;
|
||||
} else {
|
||||
unassert(errno == ENOMEM);
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
unassert(errno == ENOMEM);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -86,12 +84,16 @@ static void *_mapframe(void *p, int f) {
|
|||
*/
|
||||
void *_extend(void *p, size_t n, void *e, int f, intptr_t h) {
|
||||
char *q;
|
||||
unassert(!((uintptr_t)SHADOW(p) & (G - 1)));
|
||||
unassert((uintptr_t)p + (G << kAsanScale) <= h);
|
||||
#ifndef NDEBUG
|
||||
if ((uintptr_t)SHADOW(p) & (G - 1)) notpossible;
|
||||
if ((uintptr_t)p + (G << kAsanScale) > h) notpossible;
|
||||
#endif
|
||||
// TODO(jart): Make this spin less in non-ASAN mode.
|
||||
for (q = e; q < ((char *)p + n); q += 8) {
|
||||
if (!((uintptr_t)q & (G - 1))) {
|
||||
unassert(q + G <= (char *)h);
|
||||
#ifndef NDEBUG
|
||||
if (q + G > (char *)h) notpossible;
|
||||
#endif
|
||||
if (!_mapframe(q, f)) return 0;
|
||||
if (IsAsan()) {
|
||||
if (!((uintptr_t)SHADOW(q) & (G - 1))) {
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
#include "libc/runtime/memtrack.internal.h"
|
||||
#include "libc/thread/thread.h"
|
||||
|
||||
// nsync depends on this non-nsync lock
|
||||
|
||||
extern pthread_mutex_t __mmi_lock_obj;
|
||||
|
||||
void __mmi_lock(void) {
|
||||
|
|
|
@ -21,9 +21,11 @@
|
|||
#include "libc/intrin/describeflags.internal.h"
|
||||
#include "libc/intrin/describentoverlapped.internal.h"
|
||||
#include "libc/intrin/kprintf.h"
|
||||
#include "libc/intrin/likely.h"
|
||||
#include "libc/intrin/strace.internal.h"
|
||||
#include "libc/nt/thunk/msabi.h"
|
||||
#include "libc/nt/winsock.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/sock/internal.h"
|
||||
|
||||
__msabi extern typeof(WSARecv) *const __imp_WSARecv;
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include "libc/intrin/describeflags.internal.h"
|
||||
#include "libc/intrin/describentoverlapped.internal.h"
|
||||
#include "libc/intrin/kprintf.h"
|
||||
#include "libc/intrin/likely.h"
|
||||
#include "libc/intrin/strace.internal.h"
|
||||
#include "libc/nt/thunk/msabi.h"
|
||||
#include "libc/nt/winsock.h"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue