- Notifications
You must be signed in to change notification settings - Fork67
Description
Objects.qll
has support for identifying objects with different storage durations (static, thread local, allocated, and automatic). However, its thread local object support is limited to_Thread_local
variables.
Ideally, atss_t
variable would be recognizable as two objects:
- One object representing the variable holding the tss_t key. Usually this is an object with static lifetime.
- Another object identity for the thread local behind the
tss_t
.
Unfortunately,tss_t
currently extendsElement
, which means that it can't have two implementations of theObjectIdentity
class. Alternatively, calls totss_get()
could be consideredObjectIdentity
s, however, that doesn't match the intention of theObjectIdentity
class/library, as the threadlocal is really identified by thetss_t
.
The threadlocal objectcould be identified by thetss_create
call (similarly to how we identify dynamic memory viamalloc
calls). But it probably makes more sense to haveObjectIdentity
extendLocatable
and then have atss_t
variable produce twoObjectIdenty
s.
Otherwise the tss_t object class will closely match the malloc object class, since malloc returns a pointer to the dynamic memory just liketss_get()
returns a pointer to the thread local. Additional refactoring to share code here will be required.