| OLD | NEW |
| 1 // Copyright (c) 2006, Google Inc. | 1 // Copyright (c) 2006, Google Inc. |
| 2 // All rights reserved. | 2 // All rights reserved. |
| 3 // | 3 // |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
| 6 // met: | 6 // met: |
| 7 // | 7 // |
| 8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
| 9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
| 10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 extern const char* GetenvBeforeMain(const char* name); | 64 extern const char* GetenvBeforeMain(const char* name); |
| 65 | 65 |
| 66 // This takes as an argument an environment-variable name (like | 66 // This takes as an argument an environment-variable name (like |
| 67 // CPUPROFILE) whose value is supposed to be a file-path, and sets | 67 // CPUPROFILE) whose value is supposed to be a file-path, and sets |
| 68 // path to that path, and returns true. Non-trivial for surprising | 68 // path to that path, and returns true. Non-trivial for surprising |
| 69 // reasons, as documented in sysinfo.cc. path must have space PATH_MAX. | 69 // reasons, as documented in sysinfo.cc. path must have space PATH_MAX. |
| 70 extern bool GetUniquePathFromEnv(const char* env_name, char* path); | 70 extern bool GetUniquePathFromEnv(const char* env_name, char* path); |
| 71 | 71 |
| 72 extern int NumCPUs(); | 72 extern int NumCPUs(); |
| 73 | 73 |
| 74 void SleepForMilliseconds(int milliseconds); |
| 75 |
| 74 // processor cycles per second of each processor. Thread-safe. | 76 // processor cycles per second of each processor. Thread-safe. |
| 75 extern double CyclesPerSecond(void); | 77 extern double CyclesPerSecond(void); |
| 76 | 78 |
| 77 | 79 |
| 78 // Return true if we're running POSIX (e.g., NPTL on Linux) threads, | 80 // Return true if we're running POSIX (e.g., NPTL on Linux) threads, |
| 79 // as opposed to a non-POSIX thread libary. The thing that we care | 81 // as opposed to a non-POSIX thread libary. The thing that we care |
| 80 // about is whether a thread's pid is the same as the thread that | 82 // about is whether a thread's pid is the same as the thread that |
| 81 // spawned it. If so, this function returns true. | 83 // spawned it. If so, this function returns true. |
| 82 // Thread-safe. | 84 // Thread-safe. |
| 83 // Note: We consider false negatives to be OK. | 85 // Note: We consider false negatives to be OK. |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 char flags_[10]; | 221 char flags_[10]; |
| 220 Buffer* dynamic_buffer_; // dynamically-allocated Buffer | 222 Buffer* dynamic_buffer_; // dynamically-allocated Buffer |
| 221 bool using_maps_backing_; // true if we are looking at maps_backing instead of
maps. | 223 bool using_maps_backing_; // true if we are looking at maps_backing instead of
maps. |
| 222 }; | 224 }; |
| 223 | 225 |
| 224 #endif /* #ifndef SWIG */ | 226 #endif /* #ifndef SWIG */ |
| 225 | 227 |
| 226 // Helper routines | 228 // Helper routines |
| 227 | 229 |
| 228 namespace tcmalloc { | 230 namespace tcmalloc { |
| 229 int FillProcSelfMaps(char buf[], int size); | 231 int FillProcSelfMaps(char buf[], int size, bool* wrote_all); |
| 230 void DumpProcSelfMaps(RawFD fd); | 232 void DumpProcSelfMaps(RawFD fd); |
| 231 } | 233 } |
| 232 | 234 |
| 233 #endif /* #ifndef _SYSINFO_H_ */ | 235 #endif /* #ifndef _SYSINFO_H_ */ |
| OLD | NEW |