1 : // Copyright 2014 Google Inc. All Rights Reserved.
2 : //
3 : // Licensed under the Apache License, Version 2.0 (the "License");
4 : // you may not use this file except in compliance with the License.
5 : // You may obtain a copy of the License at
6 : //
7 : // http://www.apache.org/licenses/LICENSE-2.0
8 : //
9 : // Unless required by applicable law or agreed to in writing, software
10 : // distributed under the License is distributed on an "AS IS" BASIS,
11 : // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 : // See the License for the specific language governing permissions and
13 : // limitations under the License.
14 :
15 : #ifndef SYZYGY_AGENT_ASAN_MEMORY_NOTIFIERS_NULL_MEMORY_NOTIFIER_H_
16 : #define SYZYGY_AGENT_ASAN_MEMORY_NOTIFIERS_NULL_MEMORY_NOTIFIER_H_
17 :
18 : #include "base/logging.h"
19 : #include "syzygy/agent/asan/memory_notifier.h"
20 :
21 : namespace agent {
22 : namespace asan {
23 : namespace memory_notifiers {
24 :
25 : // Dummy notifier, useful to test objects relying on a memory notifier.
26 : class NullMemoryNotifier : public MemoryNotifierInterface {
27 : public:
28 : // Constructor.
29 E : NullMemoryNotifier() { }
30 :
31 : // Virtual destructor.
32 E : virtual ~NullMemoryNotifier() { }
33 :
34 : // @name MemoryNotifierInterface implementation.
35 : // @{
36 E : virtual void NotifyInternalUse(const void* address, size_t size) { }
37 E : virtual void NotifyFutureHeapUse(const void* address, size_t size) { }
38 E : virtual void NotifyReturnedToOS(const void* address, size_t size) { }
39 : // @}
40 : private:
41 : DISALLOW_COPY_AND_ASSIGN(NullMemoryNotifier);
42 : };
43 :
44 : } // namespace memory_notifiers
45 : } // namespace asan
46 : } // namespace agent
47 :
48 : #endif // SYZYGY_AGENT_ASAN_MEMORY_NOTIFIERS_NULL_MEMORY_NOTIFIER_H_
|