Use the right class loader allocator in ReallocMethods.

Otherwise we would leak memory.

Also complies with the JitCodeCache assumption that ArtMethods
are allocated with the classloader that loaded the class where
those ArtMethods hang.

bug: 64241268
Test: 661-classloader-allocator
Change-Id: I9e4ddbf8f40547084a1a4983459db48f68743cc7
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index 3ac87c5..fc14da1 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -7119,7 +7119,7 @@
                                                                       method_alignment_);
   const size_t old_methods_ptr_size = (old_methods != nullptr) ? old_size : 0;
   auto* methods = reinterpret_cast<LengthPrefixedArray<ArtMethod>*>(
-      Runtime::Current()->GetLinearAlloc()->Realloc(
+      class_linker_->GetAllocatorForClassLoader(klass_->GetClassLoader())->Realloc(
           self_, old_methods, old_methods_ptr_size, new_size));
   CHECK(methods != nullptr);  // Native allocation failure aborts.