libthr: Use TLS_TCB_* in _tcb_[cd]tor.
This matches libc and rtld in using the alignment (TLS_TCB_ALIGN) from machine/tls.h instead of hardcoding 16. Reviewed by: kib Sponsored by: The University of Cambridge, Google Inc. Differential Revision: https://reviews.freebsd.org/D34023
This commit is contained in:
parent
42e51b158a
commit
8de1a8131e
@ -42,7 +42,7 @@ _tcb_ctor(struct pthread *thread, int initial)
|
|||||||
if (initial)
|
if (initial)
|
||||||
tcb = _tcb_get();
|
tcb = _tcb_get();
|
||||||
else
|
else
|
||||||
tcb = _rtld_allocate_tls(NULL, sizeof(struct tcb), 16);
|
tcb = _rtld_allocate_tls(NULL, TLS_TCB_SIZE, TLS_TCB_ALIGN);
|
||||||
if (tcb)
|
if (tcb)
|
||||||
tcb->tcb_thread = thread;
|
tcb->tcb_thread = thread;
|
||||||
return (tcb);
|
return (tcb);
|
||||||
@ -52,5 +52,5 @@ void
|
|||||||
_tcb_dtor(struct tcb *tcb)
|
_tcb_dtor(struct tcb *tcb)
|
||||||
{
|
{
|
||||||
|
|
||||||
_rtld_free_tls(tcb, sizeof(struct tcb), 16);
|
_rtld_free_tls(tcb, TLS_TCB_SIZE, TLS_TCB_ALIGN);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user