Skip to content

Commit

Permalink
android: Fix Java.choose() on Android >= 14
Browse files Browse the repository at this point in the history
  • Loading branch information
mbricchi authored and oleavr committed Jul 12, 2024
1 parent 6278d00 commit 4621157
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/android.js
Original file line number Diff line number Diff line change
Expand Up @@ -591,8 +591,9 @@ function _getArtRuntimeSpec (api) {
* gc::Heap* heap_; <-- we need to find this
* std::unique_ptr<ArenaPool> jit_arena_pool_; <----- API level >= 24
* std::unique_ptr<ArenaPool> arena_pool_; __
* std::unique_ptr<ArenaPool> low_4gb_arena_pool_; <--|__ API level >= 23
* std::unique_ptr<ArenaPool> low_4gb_arena_pool_/linear_alloc_arena_pool_; <--|__ API level >= 23
* std::unique_ptr<LinearAlloc> linear_alloc_; \_
* std::atomic<LinearAlloc*> startup_linear_alloc_;<----- API level >= 34
* size_t max_spins_before_thin_lock_inflation_;
* MonitorList* monitor_list_;
* MonitorPool* monitor_pool_;
Expand Down Expand Up @@ -644,7 +645,9 @@ function _getArtRuntimeSpec (api) {
const threadListOffset = internTableOffset - pointerSize;

let heapOffset;
if (apiLevel >= 24) {
if (apiLevel >= 34) {
heapOffset = threadListOffset - (9 * pointerSize);
} else if (apiLevel >= 24) {
heapOffset = threadListOffset - (8 * pointerSize);
} else if (apiLevel >= 23) {
heapOffset = threadListOffset - (7 * pointerSize);
Expand Down

0 comments on commit 4621157

Please sign in to comment.