Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5fa71ca77d1f1fc64bbae8abceee10d67f441b40
      
https://github.com/WebKit/WebKit/commit/5fa71ca77d1f1fc64bbae8abceee10d67f441b40
  Author: Yusuke Suzuki <[email protected]>
  Date:   2026-05-01 (Fri, 01 May 2026)

  Changed paths:
    M Source/bmalloc/libpas/src/libpas/pas_fast_tls.h
    M Source/bmalloc/libpas/src/libpas/pas_thread.c
    M Source/bmalloc/libpas/src/libpas/pas_thread.h
    M Source/bmalloc/libpas/src/libpas/pas_thread_local_cache.c

  Log Message:
  -----------
  [libpas] Use static TLS destructor instead of FLS
https://bugs.webkit.org/show_bug.cgi?id=313793
rdar://175988080

Reviewed by Marcus Plutowski and Mark Lam.

Making libpas Windows TLS mechanism simpler by using static TLS destructor,
which is well-known old technique. We register a function via segment
annotation. This function will be called when thread dies. And we just
read TLS pointer, mark it as destroying, and destroying it when it is
not nullptr and it is not a marker. This removes stub of
pthread_key_create etc. completely. Also destructor will be called
automatically when libpas is loaded, while we do not need to register it
explicitly at runtime.

* Source/bmalloc/libpas/src/libpas/pas_fast_tls.h:
* Source/bmalloc/libpas/src/libpas/pas_thread.c:
(pthread_key_create): Deleted.
(pthread_getspecific): Deleted.
(pthread_setspecific): Deleted.
* Source/bmalloc/libpas/src/libpas/pas_thread.h:
* Source/bmalloc/libpas/src/libpas/pas_thread_local_cache.c:
(pas_tls_on_thread_exit):

Canonical link: https://commits.webkit.org/312466@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to