forked from OSchip/llvm-project
AdjustStackSizeLinux() is used in Lsan, Tsan and Msan non-Linux-specific code so it seems it should have more generic name and moved to a common scope.
Renamed to AdjustStackSize. Patch by Viktor Kutuzov. llvm-svn: 202011
This commit is contained in:
parent
356faa8f09
commit
cf5d8e4f29
|
@ -238,7 +238,7 @@ INTERCEPTOR(int, pthread_create, void *th, void *attr,
|
|||
pthread_attr_init(&myattr);
|
||||
attr = &myattr;
|
||||
}
|
||||
AdjustStackSizeLinux(attr);
|
||||
AdjustStackSize(attr);
|
||||
int detached = 0;
|
||||
pthread_attr_getdetachstate(attr, &detached);
|
||||
ThreadParam p;
|
||||
|
|
|
@ -1052,7 +1052,7 @@ INTERCEPTOR(int, pthread_create, void *th, void *attr, void *(*callback)(void*),
|
|||
attr = &myattr;
|
||||
}
|
||||
|
||||
AdjustStackSizeLinux(attr);
|
||||
AdjustStackSize(attr);
|
||||
|
||||
ThreadParam p;
|
||||
p.callback = callback;
|
||||
|
|
|
@ -178,6 +178,7 @@ u32 GetUid();
|
|||
void ReExec();
|
||||
bool StackSizeIsUnlimited();
|
||||
void SetStackSizeLimitInBytes(uptr limit);
|
||||
void AdjustStackSize(void *attr);
|
||||
void PrepareForSandboxing();
|
||||
|
||||
void InitTlsSize();
|
||||
|
|
|
@ -68,8 +68,6 @@ class ThreadLister {
|
|||
int bytes_read_;
|
||||
};
|
||||
|
||||
void AdjustStackSizeLinux(void *attr);
|
||||
|
||||
// Exposed for testing.
|
||||
uptr ThreadDescriptorSize();
|
||||
uptr ThreadSelf();
|
||||
|
|
|
@ -387,7 +387,7 @@ void GetThreadStackAndTls(bool main, uptr *stk_addr, uptr *stk_size,
|
|||
}
|
||||
|
||||
#ifndef SANITIZER_GO
|
||||
void AdjustStackSizeLinux(void *attr_) {
|
||||
void AdjustStackSize(void *attr_) {
|
||||
pthread_attr_t *attr = (pthread_attr_t *)attr_;
|
||||
uptr stackaddr = 0;
|
||||
size_t stacksize = 0;
|
||||
|
|
|
@ -881,7 +881,7 @@ TSAN_INTERCEPTOR(int, pthread_create,
|
|||
}
|
||||
int detached = 0;
|
||||
REAL(pthread_attr_getdetachstate)(attr, &detached);
|
||||
AdjustStackSizeLinux(attr);
|
||||
AdjustStackSize(attr);
|
||||
|
||||
ThreadParam p;
|
||||
p.callback = callback;
|
||||
|
|
Loading…
Reference in New Issue