summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Dmitrii Ishcheikin <ishcheikin@google.com> 2024-01-08 15:19:19 +0000
committer Dmitrii Ishcheikin <ishcheikin@google.com> 2024-01-22 17:49:17 +0000
commitc06c444d36207e8ee15b9faaea999b8e6848d0a5 (patch)
tree9bc7c68b2341d5e6d0e3b918dc16e7c7e499264d
parentd4b899e9fb1cc338eebcb392b3f44148a229c12e (diff)
Add visibility attributes in runtime/gc/allocator
Bug: 260881207 Test: presubmit Test: abtd app_compat_drm Test: abtd app_compat_top_100 Test: abtd app_compat_banking Change-Id: I8a1f4e57fc966efa7c9555169689d1032b6b51bc
-rw-r--r--runtime/gc/allocator/rosalloc-inl.h2
-rw-r--r--runtime/gc/allocator/rosalloc.cc2
-rw-r--r--runtime/gc/allocator/rosalloc.h21
3 files changed, 15 insertions, 10 deletions
diff --git a/runtime/gc/allocator/rosalloc-inl.h b/runtime/gc/allocator/rosalloc-inl.h
index d1c81e3aba..3bbd29659c 100644
--- a/runtime/gc/allocator/rosalloc-inl.h
+++ b/runtime/gc/allocator/rosalloc-inl.h
@@ -19,7 +19,7 @@
#include "rosalloc.h"
-namespace art {
+namespace art HIDDEN {
namespace gc {
namespace allocator {
diff --git a/runtime/gc/allocator/rosalloc.cc b/runtime/gc/allocator/rosalloc.cc
index befc3f89c9..b50ffdcd3e 100644
--- a/runtime/gc/allocator/rosalloc.cc
+++ b/runtime/gc/allocator/rosalloc.cc
@@ -34,7 +34,7 @@
#include "thread-current-inl.h"
#include "thread_list.h"
-namespace art {
+namespace art HIDDEN {
namespace gc {
namespace allocator {
diff --git a/runtime/gc/allocator/rosalloc.h b/runtime/gc/allocator/rosalloc.h
index 35cdd5e9ab..531f509fd8 100644
--- a/runtime/gc/allocator/rosalloc.h
+++ b/runtime/gc/allocator/rosalloc.h
@@ -30,12 +30,13 @@
#include "base/allocator.h"
#include "base/bit_utils.h"
+#include "base/macros.h"
#include "base/mem_map.h"
#include "base/mutex.h"
#include "runtime_globals.h"
#include "thread.h"
-namespace art {
+namespace art HIDDEN {
namespace gc {
namespace allocator {
@@ -500,7 +501,7 @@ class RosAlloc {
// The numbers of pages that are used for runs for each size bracket.
static size_t numOfPages[kNumOfSizeBrackets];
// The numbers of slots of the runs for each size bracket.
- static size_t numOfSlots[kNumOfSizeBrackets];
+ EXPORT static size_t numOfSlots[kNumOfSizeBrackets];
// The header sizes in bytes of the runs for each size bracket.
static size_t headerSizes[kNumOfSizeBrackets];
@@ -783,9 +784,11 @@ class RosAlloc {
size_t FreePages(Thread* self, void* ptr, bool already_zero) REQUIRES(lock_);
// Allocate/free a run slot.
- void* AllocFromRun(Thread* self, size_t size, size_t* bytes_allocated, size_t* usable_size,
- size_t* bytes_tl_bulk_allocated)
- REQUIRES(!lock_);
+ EXPORT void* AllocFromRun(Thread* self,
+ size_t size,
+ size_t* bytes_allocated,
+ size_t* usable_size,
+ size_t* bytes_tl_bulk_allocated) REQUIRES(!lock_);
// Allocate/free a run slot without acquiring locks.
// TODO: REQUIRES(Locks::mutator_lock_)
void* AllocFromRunThreadUnsafe(Thread* self, size_t size, size_t* bytes_allocated,
@@ -808,9 +811,11 @@ class RosAlloc {
size_t FreeInternal(Thread* self, void* ptr) REQUIRES(!lock_);
// Allocates large objects.
- void* AllocLargeObject(Thread* self, size_t size, size_t* bytes_allocated,
- size_t* usable_size, size_t* bytes_tl_bulk_allocated)
- REQUIRES(!lock_);
+ EXPORT void* AllocLargeObject(Thread* self,
+ size_t size,
+ size_t* bytes_allocated,
+ size_t* usable_size,
+ size_t* bytes_tl_bulk_allocated) REQUIRES(!lock_);
// Revoke a run by adding it to non_full_runs_ or freeing the pages.
void RevokeRun(Thread* self, size_t idx, Run* run) REQUIRES(!lock_);