Broom
1.0.0
A thread-local C++ Garbage Collector
Loading...
Searching...
No Matches
src
platform
linux
platform.cc
Go to the documentation of this file.
1
#ifdef __linux__
2
#include <pthread.h>
3
4
#include "
src/globals.h
"
5
#include "
src/macros.h
"
6
#include "
src/platform/platform-base.h
"
7
8
namespace
broom
{
9
namespace
platform {
10
void
*
GetStackBottom
() {
11
pthread_attr_t
attr
;
12
int
error
=
pthread_getattr_np
(
pthread_self
(), &
attr
);
13
if
(
error
!= 0) {
14
pthread_attr_destroy
(&
attr
);
15
return
nullptr
;
16
}
17
void
*
stack_base
;
18
size_t
stack_size
;
19
error
=
pthread_attr_getstack
(&
attr
, &
stack_base
, &
stack_size
);
20
BENSURE_EQ
(
error
, 0,
"Unexpected pthread error"
);
21
pthread_attr_destroy
(&
attr
);
22
return
SafeCast<void*>
(
SafeCast<UintPtr>
(
stack_base
) +
stack_size
);
23
}
24
}
// namespace platform
25
}
// namespace broom
26
#endif
globals.h
macros.h
BENSURE_EQ
#define BENSURE_EQ(lhs, rhs, m,...)
Definition
macros.h:26
broom::platform::GetStackBottom
void * GetStackBottom()
broom
Definition
allocator-inl.h:9
broom::queue
std::queue< T, broom::deque< T > > queue
Definition
broom-queue.h:12
platform-base.h
Generated by
1.9.8