[DGD] TLS curiosities

Felix A. Croes felix at dworkin.nl
Tue Dec 9 22:06:47 CET 2014


Blain <blain20 at gmail.com> wrote:

> In the kernel, the TLS allocation size starts off as 0.  When set by me,
> the number actually set is increased by 3.  What are these 3 extra elements
> intended for?  Also, given that certain parts of the kernel use the TLS,
> should I always leave room for TLSVAR2 and 3 and start with, e.g., storing
> "this_user" in 4 to avoid overwriting?

The increase used to be 2, and before that, 1.  Perhaps it will be 4 in
the future.  These items are reserved by the kernel library.  For you,
the first usable item index stays 0.

Regards,
Felix Croes



More information about the DGD mailing list