mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-24 10:45:42 +00:00
Bug 1739654 - Update RLBox so that locks aren't used for app_pointer in single threaded contexts r=bholley
Differential Revision: https://phabricator.services.mozilla.com/D130482
This commit is contained in:
parent
97209d1f8a
commit
e073c96dc5
2
third_party/rlbox/README-mozilla
vendored
2
third_party/rlbox/README-mozilla
vendored
@ -1,7 +1,7 @@
|
||||
This directory contains the rlbox source from the upstream repo:
|
||||
https://github.com/PLSysSec/rlbox_sandboxing_api/
|
||||
|
||||
Current version: [commit 298c785d94fe3f502c52649be292fa9da71de2e9]
|
||||
Current version: [commit 543a85c32652df9088302e9130b6b4ff5b0c0584]
|
||||
|
||||
UPDATING:
|
||||
|
||||
|
@ -23,7 +23,9 @@ private:
|
||||
|
||||
std::map<T_PointerTypeUnsigned, void*> pointer_map;
|
||||
T_PointerTypeUnsigned counter = 1;
|
||||
#ifndef RLBOX_SINGLE_THREADED_INVOCATIONS
|
||||
RLBOX_SHARED_LOCK(map_mutex);
|
||||
#endif
|
||||
|
||||
T_PointerType get_unused_index()
|
||||
{
|
||||
@ -55,7 +57,9 @@ public:
|
||||
|
||||
T_PointerType get_app_pointer_idx(void* ptr)
|
||||
{
|
||||
#ifndef RLBOX_SINGLE_THREADED_INVOCATIONS
|
||||
RLBOX_ACQUIRE_UNIQUE_GUARD(lock, map_mutex);
|
||||
#endif
|
||||
T_PointerType idx = get_unused_index();
|
||||
T_PointerTypeUnsigned idx_int = (T_PointerTypeUnsigned)idx;
|
||||
pointer_map[idx_int] = ptr;
|
||||
@ -64,7 +68,9 @@ public:
|
||||
|
||||
void remove_app_ptr(T_PointerType idx)
|
||||
{
|
||||
#ifndef RLBOX_SINGLE_THREADED_INVOCATIONS
|
||||
RLBOX_ACQUIRE_UNIQUE_GUARD(lock, map_mutex);
|
||||
#endif
|
||||
T_PointerTypeUnsigned idx_int = (T_PointerTypeUnsigned)idx;
|
||||
auto it = pointer_map.find(idx_int);
|
||||
detail::dynamic_check(it != pointer_map.end(),
|
||||
@ -74,7 +80,9 @@ public:
|
||||
|
||||
void* lookup_index(T_PointerType idx)
|
||||
{
|
||||
#ifndef RLBOX_SINGLE_THREADED_INVOCATIONS
|
||||
RLBOX_ACQUIRE_SHARED_GUARD(lock, map_mutex);
|
||||
#endif
|
||||
T_PointerTypeUnsigned idx_int = (T_PointerTypeUnsigned)idx;
|
||||
auto it = pointer_map.find(idx_int);
|
||||
detail::dynamic_check(it != pointer_map.end(),
|
||||
|
Loading…
Reference in New Issue
Block a user