OLD | NEW |
1 // Copyright (c) 2005, Google Inc. | 1 // Copyright (c) 2005, 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 18 matching lines...) Expand all Loading... |
29 | 29 |
30 // --- | 30 // --- |
31 // Author: Sanjay Ghemawat <opensource@google.com> | 31 // Author: Sanjay Ghemawat <opensource@google.com> |
32 // | 32 // |
33 // Internal logging and related utility routines. | 33 // Internal logging and related utility routines. |
34 | 34 |
35 #ifndef TCMALLOC_INTERNAL_LOGGING_H_ | 35 #ifndef TCMALLOC_INTERNAL_LOGGING_H_ |
36 #define TCMALLOC_INTERNAL_LOGGING_H_ | 36 #define TCMALLOC_INTERNAL_LOGGING_H_ |
37 | 37 |
38 #include <config.h> | 38 #include <config.h> |
39 #include <stdlib.h> // for abort() | 39 #include <stddef.h> // for size_t |
40 #ifdef HAVE_UNISTD_H | |
41 #include <unistd.h> // for write() | |
42 #endif | |
43 | 40 |
44 //------------------------------------------------------------------- | 41 //------------------------------------------------------------------- |
45 // Utility routines | 42 // Utility routines |
46 //------------------------------------------------------------------- | 43 //------------------------------------------------------------------- |
47 | 44 |
48 // Safe debugging routine: we write directly to the stderr file | 45 // Safe debugging routine: we write directly to the stderr file |
49 // descriptor and avoid FILE buffering because that may invoke | 46 // descriptor and avoid FILE buffering because that may invoke |
50 // malloc() | 47 // malloc() |
51 extern void TCMalloc_MESSAGE(const char* filename, | 48 extern void TCMalloc_MESSAGE(const char* filename, |
52 int line_number, | 49 int line_number, |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 } | 132 } |
136 | 133 |
137 void printf(const char* format, ...) | 134 void printf(const char* format, ...) |
138 #ifdef HAVE___ATTRIBUTE__ | 135 #ifdef HAVE___ATTRIBUTE__ |
139 __attribute__ ((__format__ (__printf__, 2, 3))) | 136 __attribute__ ((__format__ (__printf__, 2, 3))) |
140 #endif | 137 #endif |
141 ; | 138 ; |
142 }; | 139 }; |
143 | 140 |
144 #endif // TCMALLOC_INTERNAL_LOGGING_H_ | 141 #endif // TCMALLOC_INTERNAL_LOGGING_H_ |
OLD | NEW |