| 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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 | 184 |
| 185 // Get the current stack trace. Try to skip all routines up to and | 185 // Get the current stack trace. Try to skip all routines up to and |
| 186 // and including the caller of MallocHook::Invoke*. | 186 // and including the caller of MallocHook::Invoke*. |
| 187 // Use "skip_count" (similarly to GetStackTrace from stacktrace.h) | 187 // Use "skip_count" (similarly to GetStackTrace from stacktrace.h) |
| 188 // as a hint about how many routines to skip if better information | 188 // as a hint about how many routines to skip if better information |
| 189 // is not available. | 189 // is not available. |
| 190 inline static int GetCallerStackTrace(void** result, int max_depth, | 190 inline static int GetCallerStackTrace(void** result, int max_depth, |
| 191 int skip_count) { | 191 int skip_count) { |
| 192 return MallocHook_GetCallerStackTrace(result, max_depth, skip_count); | 192 return MallocHook_GetCallerStackTrace(result, max_depth, skip_count); |
| 193 } | 193 } |
| 194 |
| 195 // Unhooked versions of mmap() and munmap(). These should be used |
| 196 // only by experts, since they bypass heapchecking, etc. |
| 197 static void* UnhookedMMap(void *start, size_t length, int prot, int flags, |
| 198 int fd, off_t offset); |
| 199 static int UnhookedMUnmap(void *start, size_t length); |
| 194 }; | 200 }; |
| 195 | 201 |
| 196 #endif /* _MALLOC_HOOK_H_ */ | 202 #endif /* _MALLOC_HOOK_H_ */ |
| OLD | NEW |