summaryrefslogtreecommitdiff
path: root/include/lldb/Expression/IRMemoryMap.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/lldb/Expression/IRMemoryMap.h')
-rw-r--r--include/lldb/Expression/IRMemoryMap.h28
1 files changed, 14 insertions, 14 deletions
diff --git a/include/lldb/Expression/IRMemoryMap.h b/include/lldb/Expression/IRMemoryMap.h
index df8a03f4763f..026ca6b98110 100644
--- a/include/lldb/Expression/IRMemoryMap.h
+++ b/include/lldb/Expression/IRMemoryMap.h
@@ -39,7 +39,7 @@ public:
IRMemoryMap(lldb::TargetSP target_sp);
~IRMemoryMap();
- enum AllocationPolicy {
+ enum AllocationPolicy : uint8_t {
eAllocationPolicyInvalid =
0, ///< It is an error for an allocation to have this policy.
eAllocationPolicyHostOnly, ///< This allocation was created in the host and
@@ -91,32 +91,32 @@ protected:
private:
struct Allocation {
lldb::addr_t
- m_process_alloc; ///< The (unaligned) base for the remote allocation
+ m_process_alloc; ///< The (unaligned) base for the remote allocation.
lldb::addr_t
- m_process_start; ///< The base address of the allocation in the process
- size_t m_size; ///< The size of the requested allocation
- uint32_t m_permissions; ///< The access permissions on the memory in the
- ///process. In the host, the memory is always
- ///read/write.
- uint8_t m_alignment; ///< The alignment of the requested allocation
+ m_process_start; ///< The base address of the allocation in the process.
+ size_t m_size; ///< The size of the requested allocation.
DataBufferHeap m_data;
- ///< Flags
+ /// Flags. Keep these grouped together to avoid structure padding.
AllocationPolicy m_policy;
bool m_leak;
+ uint8_t m_permissions; ///< The access permissions on the memory in the
+ /// process. In the host, the memory is always
+ /// read/write.
+ uint8_t m_alignment; ///< The alignment of the requested allocation.
public:
Allocation(lldb::addr_t process_alloc, lldb::addr_t process_start,
size_t size, uint32_t permissions, uint8_t alignment,
AllocationPolicy m_policy);
- Allocation()
- : m_process_alloc(LLDB_INVALID_ADDRESS),
- m_process_start(LLDB_INVALID_ADDRESS), m_size(0), m_permissions(0),
- m_alignment(0), m_data(), m_policy(eAllocationPolicyInvalid),
- m_leak(false) {}
+ DISALLOW_COPY_AND_ASSIGN(Allocation);
};
+ static_assert(sizeof(Allocation) <=
+ (4 * sizeof(lldb::addr_t)) + sizeof(DataBufferHeap),
+ "IRMemoryMap::Allocation is larger than expected");
+
lldb::ProcessWP m_process_wp;
lldb::TargetWP m_target_wp;
typedef std::map<lldb::addr_t, Allocation> AllocationMap;