Fix up bmalloc's PerThread for use on Linux
authorggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 5 Jan 2015 23:33:54 +0000 (23:33 +0000)
committerggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 5 Jan 2015 23:33:54 +0000 (23:33 +0000)
commit49aadb25edb260e1236df65864c789eec44ca212
treea6f7fbf9c5b24adcd8c67eae655f423a4abbb525
parent51565f4df90a8becc723c7a1194070fa690e7de6
Fix up bmalloc's PerThread for use on Linux
https://bugs.webkit.org/show_bug.cgi?id=139804

Reviewed by Anders Carlsson.

The previous implementation was a bit slow.

* bmalloc/PerThread.h:
(bmalloc::PerThreadStorage<Cache>::get):
(bmalloc::PerThreadStorage::get):
(bmalloc::PerThreadStorage::init): Added a catch-all cross-platform Unix
way to do fast per-thread access without taking a lock every time. This
probably works on all the platforms we care about, and it matches other
techniques we use elsewhere in WebKit.

(bmalloc::PerThread<T>::getFastCase): Removed the conditional from
this class because PerThreadStorage now encapsulates everything that
needs to be conditional.

(bmalloc::PerThreadStorage::initSharedKeyIfNeeded): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@177931 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/bmalloc/ChangeLog
Source/bmalloc/bmalloc/PerThread.h