ART: Move to libbase StringPrintf
Remove ART's StringPrintf implementation. Fix up clients. Add
missing includes where necessary.
Test: m test-art-host
Change-Id: I564038d5868595ac3bb88d641af1000cea940e5a
diff --git a/runtime/gc/space/image_space.cc b/runtime/gc/space/image_space.cc
index 76f3692..e03958d 100644
--- a/runtime/gc/space/image_space.cc
+++ b/runtime/gc/space/image_space.cc
@@ -22,6 +22,7 @@
#include <sys/types.h>
#include <unistd.h>
+#include "android-base/stringprintf.h"
#include "android-base/strings.h"
#include "art_method.h"
@@ -45,6 +46,9 @@
namespace gc {
namespace space {
+using android::base::StringAppendF;
+using android::base::StringPrintf;
+
Atomic<uint32_t> ImageSpace::bitmap_index_(0);
ImageSpace::ImageSpace(const std::string& image_filename,
diff --git a/runtime/gc/space/image_space_fs.h b/runtime/gc/space/image_space_fs.h
index fa941c0..5999548 100644
--- a/runtime/gc/space/image_space_fs.h
+++ b/runtime/gc/space/image_space_fs.h
@@ -20,9 +20,10 @@
#include <dirent.h>
#include <dlfcn.h>
+#include "android-base/stringprintf.h"
+
#include "base/logging.h"
#include "base/macros.h"
-#include "base/stringprintf.h"
#include "base/unix_file/fd_file.h"
#include "globals.h"
#include "os.h"
@@ -56,7 +57,7 @@
continue;
}
// We only want to delete regular files and symbolic links.
- std::string file = StringPrintf("%s/%s", dir.c_str(), name);
+ std::string file = android::base::StringPrintf("%s/%s", dir.c_str(), name);
if (de->d_type != DT_REG && de->d_type != DT_LNK) {
if (de->d_type == DT_DIR) {
if (recurse) {
diff --git a/runtime/gc/space/malloc_space.cc b/runtime/gc/space/malloc_space.cc
index b1572cc..a186f4c 100644
--- a/runtime/gc/space/malloc_space.cc
+++ b/runtime/gc/space/malloc_space.cc
@@ -16,6 +16,8 @@
#include "malloc_space.h"
+#include "android-base/stringprintf.h"
+
#include "gc/accounting/card_table-inl.h"
#include "gc/accounting/space_bitmap-inl.h"
#include "gc/heap.h"
@@ -33,6 +35,8 @@
namespace gc {
namespace space {
+using android::base::StringPrintf;
+
size_t MallocSpace::bitmap_index_ = 0;
MallocSpace::MallocSpace(const std::string& name, MemMap* mem_map,