Compress mini-debug-info in small chunks.
Compress the mini-debug-info in small independent parts.
This still results in standard compressed data stream.
However, by dividing into chunks, the compressed data
can be random accessed - that is, it makes it possible
to decompressed only the data that is needed.
This increases size of .oat files by 1.2%.
Bug: 110133331
Test: test.py --host -b -t 137
Change-Id: I9d1d4f1971b3c072d45ca4289f8c15f44da4036a
diff --git a/compiler/debug/xz_utils.h b/compiler/debug/xz_utils.h
new file mode 100644
index 0000000..c4076c6
--- /dev/null
+++ b/compiler/debug/xz_utils.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ART_COMPILER_DEBUG_XZ_UTILS_H_
+#define ART_COMPILER_DEBUG_XZ_UTILS_H_
+
+#include <vector>
+
+#include "base/array_ref.h"
+
+namespace art {
+namespace debug {
+
+void XzCompress(ArrayRef<uint8_t> src, std::vector<uint8_t>* dst);
+
+} // namespace debug
+} // namespace art
+
+#endif // ART_COMPILER_DEBUG_XZ_UTILS_H_