Broom
1.0.0
A thread-local C++ Garbage Collector
Loading...
Searching...
No Matches
src
platform
freebsd
platform.cc
Go to the documentation of this file.
1
#ifdef __FreeBSD__
2
3
#include <pthread_np.h>
4
5
#include "
src/globals.h
"
6
#include "
src/macros.h
"
7
#include "
src/platform/platform-base.h
"
8
9
namespace
broom
{
10
namespace
platform {
11
void
*
GetStackBottom
() {
12
pthread_attr_t
attr
;
13
pthread_attr_init
(&
attr
);
14
int
error
=
pthread_attr_get_np
(
pthread_self
(), &
attr
);
15
if
(
error
!= 0) {
16
pthread_attr_destroy
(&
attr
);
17
return
nullptr
;
18
}
19
void
*
stack_base
;
20
size_t
stack_size
;
21
error
=
pthread_attr_getstack
(&
attr
, &
stack_base
, &
stack_size
);
22
BENSURE_EQ
(
error
, 0,
"Unexpected pthread error"
);
23
pthread_attr_destroy
(&
attr
);
24
return
SafeCast<void*>
(
SafeCast<UintPtr>
(
stack_base
) +
stack_size
);
25
}
26
}
// namespace platform
27
}
// namespace broom
28
#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