utils.h revision aded5f7ab991f3c1132851599d3bc60ff6707eed
1a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapiro// Copyright 2011 Google Inc. All Rights Reserved.
2a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapiro
3a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapiro#ifndef ART_SRC_UTILS_H_
4a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapiro#define ART_SRC_UTILS_H_
5a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapiro
6578bbdc684db8ed68e9fedbc678669d27fa68b6eBrian Carlstrom#include "globals.h"
7db4d54081f09abcbe97ffdf615874f2809a9e777Brian Carlstrom#include "logging.h"
811e45077acba2e757799a00b3be9d63fec36a7ccElliott Hughes#include "stringpiece.h"
9c7ac37f0b8b64cfb53d8b9cc8dddbb34be3dd5eeElliott Hughes#include "stringprintf.h"
10a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapiro
1192b3b5623ec8b65f3e099c076e247bb8273692f8Elliott Hughes#include <pthread.h>
1234023801bd544e613d6e85c9a5b2e743f3710e8fElliott Hughes#include <string>
1334023801bd544e613d6e85c9a5b2e743f3710e8fElliott Hughes#include <vector>
1434023801bd544e613d6e85c9a5b2e743f3710e8fElliott Hughes
156b6b5f0e67ce03f38223a525612955663bc1799bCarl Shapironamespace art {
16a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapiro
1754e7df1896a4066cbb9fe6f72249829f0b8c49c6Elliott Hughesclass Class;
18a2501990dd0f68baf38ce19251949d7bb3ecfe5aElliott Hughesclass Field;
19a0b8feb34a8492c6b8d430f6ca0716e7ff4f4c57Elliott Hughesclass Method;
2011e45077acba2e757799a00b3be9d63fec36a7ccElliott Hughesclass Object;
215174fe6e4e931c423e910366ff22ce0838567940Elliott Hughesclass String;
2211e45077acba2e757799a00b3be9d63fec36a7ccElliott Hughes
23a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapirotemplate<typename T>
24a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapirostatic inline bool IsPowerOfTwo(T x) {
25a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapiro  return (x & (x - 1)) == 0;
26a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapiro}
27a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapiro
28a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapirotemplate<typename T>
29a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapirostatic inline bool IsAligned(T x, int n) {
30a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapiro  CHECK(IsPowerOfTwo(n));
31a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapiro  return (x & (n - 1)) == 0;
32a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapiro}
33a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapiro
34a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapirotemplate<typename T>
35a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapirostatic inline bool IsAligned(T* x, int n) {
36a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapiro  return IsAligned(reinterpret_cast<uintptr_t>(x), n);
37a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapiro}
38a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapiro
39a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapiro// Check whether an N-bit two's-complement representation can hold value.
40a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapirostatic inline bool IsInt(int N, word value) {
41a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapiro  CHECK_LT(0, N);
42a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapiro  CHECK_LT(N, kBitsPerWord);
43a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapiro  word limit = static_cast<word>(1) << (N - 1);
44a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapiro  return (-limit <= value) && (value < limit);
45a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapiro}
46a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapiro
47a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapirostatic inline bool IsUint(int N, word value) {
48a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapiro  CHECK_LT(0, N);
49a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapiro  CHECK_LT(N, kBitsPerWord);
50a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapiro  word limit = static_cast<word>(1) << N;
51a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapiro  return (0 <= value) && (value < limit);
52a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapiro}
53a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapiro
54a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapirostatic inline bool IsAbsoluteUint(int N, word value) {
55a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapiro  CHECK_LT(0, N);
56a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapiro  CHECK_LT(N, kBitsPerWord);
57a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapiro  if (value < 0) value = -value;
58a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapiro  return IsUint(N, value);
59a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapiro}
60a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapiro
61b033c75ebda80ac75f936366fe78d1edf5cec937Ian Rogersstatic inline int32_t Low16Bits(int32_t value) {
62b033c75ebda80ac75f936366fe78d1edf5cec937Ian Rogers  return static_cast<int32_t>(value & 0xffff);
63b033c75ebda80ac75f936366fe78d1edf5cec937Ian Rogers}
64b033c75ebda80ac75f936366fe78d1edf5cec937Ian Rogers
65b033c75ebda80ac75f936366fe78d1edf5cec937Ian Rogersstatic inline int32_t High16Bits(int32_t value) {
66b033c75ebda80ac75f936366fe78d1edf5cec937Ian Rogers  return static_cast<int32_t>(value >> 16);
67b033c75ebda80ac75f936366fe78d1edf5cec937Ian Rogers}
68a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapiro
69a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapirostatic inline int32_t Low32Bits(int64_t value) {
70a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapiro  return static_cast<int32_t>(value);
71a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapiro}
72a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapiro
73a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapirostatic inline int32_t High32Bits(int64_t value) {
74a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapiro  return static_cast<int32_t>(value >> 32);
75a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapiro}
76a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapiro
7761e019d291583029c01b61b93bea750f2b663c37Carl Shapirotemplate<typename T>
7861e019d291583029c01b61b93bea750f2b663c37Carl Shapirostatic inline T RoundDown(T x, int n) {
7961e019d291583029c01b61b93bea750f2b663c37Carl Shapiro  CHECK(IsPowerOfTwo(n));
8061e019d291583029c01b61b93bea750f2b663c37Carl Shapiro  return (x & -n);
8161e019d291583029c01b61b93bea750f2b663c37Carl Shapiro}
8261e019d291583029c01b61b93bea750f2b663c37Carl Shapiro
8361e019d291583029c01b61b93bea750f2b663c37Carl Shapirotemplate<typename T>
8461e019d291583029c01b61b93bea750f2b663c37Carl Shapirostatic inline T RoundUp(T x, int n) {
8561e019d291583029c01b61b93bea750f2b663c37Carl Shapiro  return RoundDown(x + n - 1, n);
8661e019d291583029c01b61b93bea750f2b663c37Carl Shapiro}
8761e019d291583029c01b61b93bea750f2b663c37Carl Shapiro
88a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapiro// Implementation is from "Hacker's Delight" by Henry S. Warren, Jr.,
891fb8620309a4e94d11879aabc33364acfa733904Carl Shapiro// figure 3-3, page 48, where the function is called clp2.
901fb8620309a4e94d11879aabc33364acfa733904Carl Shapirostatic inline uint32_t RoundUpToPowerOfTwo(uint32_t x) {
911fb8620309a4e94d11879aabc33364acfa733904Carl Shapiro  x = x - 1;
921fb8620309a4e94d11879aabc33364acfa733904Carl Shapiro  x = x | (x >> 1);
931fb8620309a4e94d11879aabc33364acfa733904Carl Shapiro  x = x | (x >> 2);
941fb8620309a4e94d11879aabc33364acfa733904Carl Shapiro  x = x | (x >> 4);
951fb8620309a4e94d11879aabc33364acfa733904Carl Shapiro  x = x | (x >> 8);
961fb8620309a4e94d11879aabc33364acfa733904Carl Shapiro  x = x | (x >> 16);
971fb8620309a4e94d11879aabc33364acfa733904Carl Shapiro  return x + 1;
981fb8620309a4e94d11879aabc33364acfa733904Carl Shapiro}
991fb8620309a4e94d11879aabc33364acfa733904Carl Shapiro
1001fb8620309a4e94d11879aabc33364acfa733904Carl Shapiro// Implementation is from "Hacker's Delight" by Henry S. Warren, Jr.,
101a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapiro// figure 5-2, page 66, where the function is called pop.
102a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapirostatic inline int CountOneBits(uint32_t x) {
103a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapiro  x = x - ((x >> 1) & 0x55555555);
104a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapiro  x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
105a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapiro  x = (x + (x >> 4)) & 0x0F0F0F0F;
106a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapiro  x = x + (x >> 8);
107a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapiro  x = x + (x >> 16);
108a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapiro  return static_cast<int>(x & 0x0000003F);
109a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapiro}
110a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapiro
111db4d54081f09abcbe97ffdf615874f2809a9e777Brian Carlstrom#define CLZ(x) __builtin_clz(x)
112db4d54081f09abcbe97ffdf615874f2809a9e777Brian Carlstrom
11346b92ba72247e10884714d0b683bdb5e9d9ce59dElliott Hughesstatic inline bool NeedsEscaping(uint16_t ch) {
11446b92ba72247e10884714d0b683bdb5e9d9ce59dElliott Hughes  return (ch < ' ' || ch > '~');
11546b92ba72247e10884714d0b683bdb5e9d9ce59dElliott Hughes}
11646b92ba72247e10884714d0b683bdb5e9d9ce59dElliott Hughes
117c7ac37f0b8b64cfb53d8b9cc8dddbb34be3dd5eeElliott Hughesstatic inline std::string PrintableChar(uint16_t ch) {
118c7ac37f0b8b64cfb53d8b9cc8dddbb34be3dd5eeElliott Hughes  std::string result;
11946b92ba72247e10884714d0b683bdb5e9d9ce59dElliott Hughes  result += '\'';
12046b92ba72247e10884714d0b683bdb5e9d9ce59dElliott Hughes  if (NeedsEscaping(ch)) {
12146b92ba72247e10884714d0b683bdb5e9d9ce59dElliott Hughes    StringAppendF(&result, "\\u%04x", ch);
12246b92ba72247e10884714d0b683bdb5e9d9ce59dElliott Hughes  } else {
123c7ac37f0b8b64cfb53d8b9cc8dddbb34be3dd5eeElliott Hughes    result += ch;
124c7ac37f0b8b64cfb53d8b9cc8dddbb34be3dd5eeElliott Hughes  }
12546b92ba72247e10884714d0b683bdb5e9d9ce59dElliott Hughes  result += '\'';
126c7ac37f0b8b64cfb53d8b9cc8dddbb34be3dd5eeElliott Hughes  return result;
127c7ac37f0b8b64cfb53d8b9cc8dddbb34be3dd5eeElliott Hughes}
128c7ac37f0b8b64cfb53d8b9cc8dddbb34be3dd5eeElliott Hughes
12946b92ba72247e10884714d0b683bdb5e9d9ce59dElliott Hughes// TODO: assume the content is UTF-8, and show code point escapes?
130c7ac37f0b8b64cfb53d8b9cc8dddbb34be3dd5eeElliott Hughestemplate<typename StringT>
131c7ac37f0b8b64cfb53d8b9cc8dddbb34be3dd5eeElliott Hughesstatic inline std::string PrintableString(const StringT& s) {
132c7ac37f0b8b64cfb53d8b9cc8dddbb34be3dd5eeElliott Hughes  std::string result;
133c7ac37f0b8b64cfb53d8b9cc8dddbb34be3dd5eeElliott Hughes  result += '"';
134b465ab0e103d7760df903c1fddf4fa6b89d5d1f5Elliott Hughes  for (typename StringT::const_iterator it = s.begin(); it != s.end(); ++it) {
135c7ac37f0b8b64cfb53d8b9cc8dddbb34be3dd5eeElliott Hughes    char ch = *it;
13646b92ba72247e10884714d0b683bdb5e9d9ce59dElliott Hughes    if (NeedsEscaping(ch)) {
137c7ac37f0b8b64cfb53d8b9cc8dddbb34be3dd5eeElliott Hughes      StringAppendF(&result, "\\x%02x", ch & 0xff);
13846b92ba72247e10884714d0b683bdb5e9d9ce59dElliott Hughes    } else {
13946b92ba72247e10884714d0b683bdb5e9d9ce59dElliott Hughes      result += ch;
140c7ac37f0b8b64cfb53d8b9cc8dddbb34be3dd5eeElliott Hughes    }
141c7ac37f0b8b64cfb53d8b9cc8dddbb34be3dd5eeElliott Hughes  }
142c7ac37f0b8b64cfb53d8b9cc8dddbb34be3dd5eeElliott Hughes  result += '"';
143c7ac37f0b8b64cfb53d8b9cc8dddbb34be3dd5eeElliott Hughes  return result;
144c7ac37f0b8b64cfb53d8b9cc8dddbb34be3dd5eeElliott Hughes}
145c7ac37f0b8b64cfb53d8b9cc8dddbb34be3dd5eeElliott Hughes
14654e7df1896a4066cbb9fe6f72249829f0b8c49c6Elliott Hughes// Used to implement PrettyClass, PrettyField, PrettyMethod, and PrettyTypeOf,
14754e7df1896a4066cbb9fe6f72249829f0b8c49c6Elliott Hughes// one of which is probably more useful to you.
148a0b8feb34a8492c6b8d430f6ca0716e7ff4f4c57Elliott Hughes// Returns a human-readable equivalent of 'descriptor'. So "I" would be "int",
149a0b8feb34a8492c6b8d430f6ca0716e7ff4f4c57Elliott Hughes// "[[I" would be "int[][]", "[Ljava/lang/String;" would be
150a0b8feb34a8492c6b8d430f6ca0716e7ff4f4c57Elliott Hughes// "java.lang.String[]", and so forth.
1515174fe6e4e931c423e910366ff22ce0838567940Elliott Hughesstd::string PrettyDescriptor(const String* descriptor);
1526c8867daab4af4667e0e816f6beafa7c5d13e043Elliott Hughesstd::string PrettyDescriptor(const std::string& descriptor);
15311e45077acba2e757799a00b3be9d63fec36a7ccElliott Hughes
15454e7df1896a4066cbb9fe6f72249829f0b8c49c6Elliott Hughes// Returns a human-readable signature for 'f'. Something like "a.b.C.f" or
15554e7df1896a4066cbb9fe6f72249829f0b8c49c6Elliott Hughes// "int a.b.C.f" (depending on the value of 'with_type').
15654e7df1896a4066cbb9fe6f72249829f0b8c49c6Elliott Hughesstd::string PrettyField(const Field* f, bool with_type = true);
157a2501990dd0f68baf38ce19251949d7bb3ecfe5aElliott Hughes
158a0b8feb34a8492c6b8d430f6ca0716e7ff4f4c57Elliott Hughes// Returns a human-readable signature for 'm'. Something like "a.b.C.m" or
159a0b8feb34a8492c6b8d430f6ca0716e7ff4f4c57Elliott Hughes// "a.b.C.m(II)V" (depending on the value of 'with_signature').
160dfd3d70e58c37b5d56eded3a4469082d8bb26ee0buzbeestd::string PrettyMethod(const Method* m, bool with_signature = true);
161a0b8feb34a8492c6b8d430f6ca0716e7ff4f4c57Elliott Hughes
162a0b8feb34a8492c6b8d430f6ca0716e7ff4f4c57Elliott Hughes// Returns a human-readable form of the name of the *class* of the given object.
163a0b8feb34a8492c6b8d430f6ca0716e7ff4f4c57Elliott Hughes// So given an instance of java.lang.String, the output would
16411e45077acba2e757799a00b3be9d63fec36a7ccElliott Hughes// be "java.lang.String". Given an array of int, the output would be "int[]".
16511e45077acba2e757799a00b3be9d63fec36a7ccElliott Hughes// Given String.class, the output would be "java.lang.Class<java.lang.String>".
16654e7df1896a4066cbb9fe6f72249829f0b8c49c6Elliott Hughesstd::string PrettyTypeOf(const Object* obj);
16754e7df1896a4066cbb9fe6f72249829f0b8c49c6Elliott Hughes
16854e7df1896a4066cbb9fe6f72249829f0b8c49c6Elliott Hughes// Returns a human-readable form of the name of the given class.
16954e7df1896a4066cbb9fe6f72249829f0b8c49c6Elliott Hughes// Given String.class, the output would be "java.lang.Class<java.lang.String>".
17054e7df1896a4066cbb9fe6f72249829f0b8c49c6Elliott Hughesstd::string PrettyClass(const Class* c);
17111e45077acba2e757799a00b3be9d63fec36a7ccElliott Hughes
17279082e367845bbd68ec44ef2ddd1be8ef0e1550fElliott Hughes// Performs JNI name mangling as described in section 11.3 "Linking Native Methods"
17379082e367845bbd68ec44ef2ddd1be8ef0e1550fElliott Hughes// of the JNI spec.
17479082e367845bbd68ec44ef2ddd1be8ef0e1550fElliott Hughesstd::string MangleForJni(const std::string& s);
17579082e367845bbd68ec44ef2ddd1be8ef0e1550fElliott Hughes
176f91c8c328c922ecd522e1d3508d2603e78de8a7bBrian Carlstrom// Turn "java.lang.String" into "Ljava/lang/String;".
177f91c8c328c922ecd522e1d3508d2603e78de8a7bBrian Carlstromstd::string DotToDescriptor(const char* class_name);
178f91c8c328c922ecd522e1d3508d2603e78de8a7bBrian Carlstrom
179aded5f7ab991f3c1132851599d3bc60ff6707eedBrian Carlstrom// Turn "Ljava/lang/String;" into "java.lang.String".
180aded5f7ab991f3c1132851599d3bc60ff6707eedBrian Carlstromstd::string DescriptorToDot(const std::string& descriptor);
181aded5f7ab991f3c1132851599d3bc60ff6707eedBrian Carlstrom
18264bf5a33d55aa779ef452552a466943002d39e4fElliott Hughes// Tests whether 's' is a valid class name.
18364bf5a33d55aa779ef452552a466943002d39e4fElliott Hughes// name_or_descriptor
18464bf5a33d55aa779ef452552a466943002d39e4fElliott Hughes//     true  => "java/lang/String"
18564bf5a33d55aa779ef452552a466943002d39e4fElliott Hughes//     false => "Ljava/lang/String;" (i.e. "descriptor")
18664bf5a33d55aa779ef452552a466943002d39e4fElliott Hughes// dot_or_slash
18764bf5a33d55aa779ef452552a466943002d39e4fElliott Hughes//     true  => "java.lang.String"
18864bf5a33d55aa779ef452552a466943002d39e4fElliott Hughes//     false => "java/lang/String" (i.e. "dot or slash")
18964bf5a33d55aa779ef452552a466943002d39e4fElliott Hughesbool IsValidClassName(const char* s, bool name_or_descriptor, bool dot_or_slash);
19064bf5a33d55aa779ef452552a466943002d39e4fElliott Hughes
19179082e367845bbd68ec44ef2ddd1be8ef0e1550fElliott Hughes// Returns the JNI native function name for the non-overloaded method 'm'.
19279082e367845bbd68ec44ef2ddd1be8ef0e1550fElliott Hughesstd::string JniShortName(const Method* m);
19379082e367845bbd68ec44ef2ddd1be8ef0e1550fElliott Hughes// Returns the JNI native function name for the overloaded method 'm'.
19479082e367845bbd68ec44ef2ddd1be8ef0e1550fElliott Hughesstd::string JniLongName(const Method* m);
19579082e367845bbd68ec44ef2ddd1be8ef0e1550fElliott Hughes
196d92bec457dc6c506c80e9da6b8e0c958266b5cdcElliott Hughesbool ReadFileToString(const std::string& file_name, std::string* result);
197c143c55718342519db5398e41dda31422cf16c79buzbee
198e27955ca3ca960928d4dbd6cb79711fce06950b3Elliott Hughes// Returns the current date in ISO yyyy-mm-dd hh:mm:ss format.
199e27955ca3ca960928d4dbd6cb79711fce06950b3Elliott Hughesstd::string GetIsoDate();
200e27955ca3ca960928d4dbd6cb79711fce06950b3Elliott Hughes
20134023801bd544e613d6e85c9a5b2e743f3710e8fElliott Hughes// Splits a string using the given delimiter character into a vector of
20234023801bd544e613d6e85c9a5b2e743f3710e8fElliott Hughes// strings. Empty strings will be omitted.
20334023801bd544e613d6e85c9a5b2e743f3710e8fElliott Hughesvoid Split(const std::string& s, char delim, std::vector<std::string>& result);
20434023801bd544e613d6e85c9a5b2e743f3710e8fElliott Hughes
20542ee14279065352a4b9a3e8028d02c567e847d05Elliott Hughes// Returns the calling thread's tid. (The C libraries don't expose this.)
20642ee14279065352a4b9a3e8028d02c567e847d05Elliott Hughespid_t GetTid();
20742ee14279065352a4b9a3e8028d02c567e847d05Elliott Hughes
208dcc247493fd8fb243e335c3ec08e5e625896a47cElliott Hughes// Sets the name of the current thread. The name may be truncated to an
209dcc247493fd8fb243e335c3ec08e5e625896a47cElliott Hughes// implementation-defined limit.
210dcc247493fd8fb243e335c3ec08e5e625896a47cElliott Hughesvoid SetThreadName(const char* name);
211dcc247493fd8fb243e335c3ec08e5e625896a47cElliott Hughes
2126b6b5f0e67ce03f38223a525612955663bc1799bCarl Shapiro}  // namespace art
213a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapiro
214a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapiro#endif  // ART_SRC_UTILS_H_
215