summaryrefslogtreecommitdiffstats
path: root/runtime/gc/space/malloc_space.h
diff options
context:
space:
mode:
authorHiroshi Yamauchi <yamauchi@google.com>2015-03-09 11:57:48 -0700
committerHiroshi Yamauchi <yamauchi@google.com>2015-03-11 15:32:59 -0700
commit4460a84be92b5a94ecfb5c650aef4945ab849c93 (patch)
tree2167b79cf593d5ff686aaf0e3bca3b7c571c6d69 /runtime/gc/space/malloc_space.h
parent4cfe74cb50b73f5f4b6dd32aabed55d044afe348 (diff)
downloadandroid_art-4460a84be92b5a94ecfb5c650aef4945ab849c93.tar.gz
android_art-4460a84be92b5a94ecfb5c650aef4945ab849c93.tar.bz2
android_art-4460a84be92b5a94ecfb5c650aef4945ab849c93.zip
Rosalloc thread local allocation path without a cas.
Speedup on N4: MemAllocTest 3044 -> 2396 (~21% reduction) BinaryTrees 4101 -> 2929 (~26% reduction) Bug: 9986565 Change-Id: Ia1d1a37b9e001f903c3c056e8ec68fc8c623a78b
Diffstat (limited to 'runtime/gc/space/malloc_space.h')
-rw-r--r--runtime/gc/space/malloc_space.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/runtime/gc/space/malloc_space.h b/runtime/gc/space/malloc_space.h
index 06239e5e73..bbf1bbbdbd 100644
--- a/runtime/gc/space/malloc_space.h
+++ b/runtime/gc/space/malloc_space.h
@@ -55,10 +55,11 @@ class MallocSpace : public ContinuousMemMapAllocSpace {
// Allocate num_bytes allowing the underlying space to grow.
virtual mirror::Object* AllocWithGrowth(Thread* self, size_t num_bytes,
- size_t* bytes_allocated, size_t* usable_size) = 0;
+ size_t* bytes_allocated, size_t* usable_size,
+ size_t* bytes_tl_bulk_allocated) = 0;
// Allocate num_bytes without allowing the underlying space to grow.
virtual mirror::Object* Alloc(Thread* self, size_t num_bytes, size_t* bytes_allocated,
- size_t* usable_size) = 0;
+ size_t* usable_size, size_t* bytes_tl_bulk_allocated) = 0;
// Return the storage space required by obj. If usable_size isn't nullptr then it is set to the
// amount of the storage space that may be used by obj.
virtual size_t AllocationSize(mirror::Object* obj, size_t* usable_size) = 0;
@@ -67,6 +68,11 @@ class MallocSpace : public ContinuousMemMapAllocSpace {
virtual size_t FreeList(Thread* self, size_t num_ptrs, mirror::Object** ptrs)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) = 0;
+ // Returns the maximum bytes that could be allocated for the given
+ // size in bulk, that is the maximum value for the
+ // bytes_allocated_bulk out param returned by MallocSpace::Alloc().
+ virtual size_t MaxBytesBulkAllocatedFor(size_t num_bytes) = 0;
+
#ifndef NDEBUG
virtual void CheckMoreCoreForPrecondition() {} // to be overridden in the debug build.
#else