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 : // Internal implementation details for block.h. Not meant to be included
16 : // directly.
17 :
18 : #ifndef SYZYGY_AGENT_ASAN_BLOCK_IMPL_H_
19 : #define SYZYGY_AGENT_ASAN_BLOCK_IMPL_H_
20 :
21 m : namespace agent {
22 m : namespace asan {
23 :
24 : // Forward declaration.
25 m : struct BlockInfo;
26 :
27 : // A structure describing the layout of a block. This is largely implementation
28 : // detail, but exposed for unittesting. As far as the user is concerned this is
29 : // an opaque blob.
30 m : struct BlockLayout {
31 : // The alignment of the entire block.
32 m : size_t block_alignment;
33 : // The size of the entire block (the rest of the fields summed).
34 m : size_t block_size;
35 :
36 : // Left redzone.
37 m : size_t header_size;
38 m : size_t header_padding_size;
39 : // Body.
40 m : size_t body_size;
41 : // Right redzone.
42 m : size_t trailer_padding_size;
43 m : size_t trailer_size;
44 m : };
45 :
46 : // Identifies whole pages that are spanned by the redzones and body of the
47 : // given block. Directly sets the various *_pages* fields in @p block_info.
48 : // @param block_info The block information to be inspected and modified.
49 : // @note This is exposed as a convience function, but it is not meant to be
50 : // directly called by the user.
51 m : void BlockIdentifyWholePages(BlockInfo* block_info);
52 :
53 m : } // namespace asan
54 m : } // namespace agent
55 :
56 : #endif // SYZYGY_AGENT_ASAN_BLOCK_IMPL_H_
|