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:
Kostya Serebryany 2014-02-24 08:53:26 +00:00
parent 356faa8f09
commit cf5d8e4f29
6 changed files with 5 additions and 6 deletions

View File

@ -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;

View File

@ -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;

View File

@ -178,6 +178,7 @@ u32 GetUid();
void ReExec();
bool StackSizeIsUnlimited();
void SetStackSizeLimitInBytes(uptr limit);
void AdjustStackSize(void *attr);
void PrepareForSandboxing();
void InitTlsSize();

View File

@ -68,8 +68,6 @@ class ThreadLister {
int bytes_read_;
};
void AdjustStackSizeLinux(void *attr);
// Exposed for testing.
uptr ThreadDescriptorSize();
uptr ThreadSelf();

View File

@ -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;

View File

@ -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;