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 23 matching lines...) Expand all Loading... |
34 // to use malloc-hook inside the tcmalloc system. It does not hold | 34 // to use malloc-hook inside the tcmalloc system. It does not hold |
35 // any of the client-facing calls that are used to add new hooks. | 35 // any of the client-facing calls that are used to add new hooks. |
36 | 36 |
37 #ifndef _MALLOC_HOOK_INL_H_ | 37 #ifndef _MALLOC_HOOK_INL_H_ |
38 #define _MALLOC_HOOK_INL_H_ | 38 #define _MALLOC_HOOK_INL_H_ |
39 | 39 |
40 #include <stddef.h> | 40 #include <stddef.h> |
41 #include <sys/types.h> | 41 #include <sys/types.h> |
42 #include "base/atomicops.h" | 42 #include "base/atomicops.h" |
43 #include "base/basictypes.h" | 43 #include "base/basictypes.h" |
44 #include <google/malloc_hook.h> | 44 #include <gperftools/malloc_hook.h> |
45 | 45 |
46 namespace base { namespace internal { | 46 namespace base { namespace internal { |
47 | 47 |
48 // The following (implementation) code is DEPRECATED. | 48 // The following (implementation) code is DEPRECATED. |
49 // A simple atomic pointer class that can be initialized by the linker | 49 // A simple atomic pointer class that can be initialized by the linker |
50 // when you define a namespace-scope variable as: | 50 // when you define a namespace-scope variable as: |
51 // | 51 // |
52 // AtomicPtr<Foo*> my_global = { &initial_value }; | 52 // AtomicPtr<Foo*> my_global = { &initial_value }; |
53 // | 53 // |
54 // This isn't suitable for a general atomic<> class because of the | 54 // This isn't suitable for a general atomic<> class because of the |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 if (!base::internal::sbrk_hooks_.empty() && increment != 0) { | 313 if (!base::internal::sbrk_hooks_.empty() && increment != 0) { |
314 InvokeSbrkHookSlow(result, increment); | 314 InvokeSbrkHookSlow(result, increment); |
315 } | 315 } |
316 // The following code is DEPRECATED. | 316 // The following code is DEPRECATED. |
317 MallocHook::SbrkHook hook = MallocHook::GetSbrkHook(); | 317 MallocHook::SbrkHook hook = MallocHook::GetSbrkHook(); |
318 if (hook != NULL && increment != 0) (*hook)(result, increment); | 318 if (hook != NULL && increment != 0) (*hook)(result, increment); |
319 // End DEPRECATED code. | 319 // End DEPRECATED code. |
320 } | 320 } |
321 | 321 |
322 #endif /* _MALLOC_HOOK_INL_H_ */ | 322 #endif /* _MALLOC_HOOK_INL_H_ */ |
OLD | NEW |