diff options
Diffstat (limited to 'src/common')
| -rw-r--r-- | src/common/page_table.cpp | 1 | ||||
| -rw-r--r-- | src/common/page_table.h | 1 | ||||
| -rw-r--r-- | src/common/scratch_buffer.h | 17 | ||||
| -rw-r--r-- | src/common/settings.cpp | 2 |
4 files changed, 18 insertions, 3 deletions
diff --git a/src/common/page_table.cpp b/src/common/page_table.cpp index b744b68ce..4b1690269 100644 --- a/src/common/page_table.cpp +++ b/src/common/page_table.cpp | |||
| @@ -66,6 +66,7 @@ void PageTable::Resize(std::size_t address_space_width_in_bits, std::size_t page | |||
| 66 | << (address_space_width_in_bits - page_size_in_bits)}; | 66 | << (address_space_width_in_bits - page_size_in_bits)}; |
| 67 | pointers.resize(num_page_table_entries); | 67 | pointers.resize(num_page_table_entries); |
| 68 | backing_addr.resize(num_page_table_entries); | 68 | backing_addr.resize(num_page_table_entries); |
| 69 | blocks.resize(num_page_table_entries); | ||
| 69 | current_address_space_width_in_bits = address_space_width_in_bits; | 70 | current_address_space_width_in_bits = address_space_width_in_bits; |
| 70 | page_size = 1ULL << page_size_in_bits; | 71 | page_size = 1ULL << page_size_in_bits; |
| 71 | } | 72 | } |
diff --git a/src/common/page_table.h b/src/common/page_table.h index 1ad3a9f8b..fec8378f3 100644 --- a/src/common/page_table.h +++ b/src/common/page_table.h | |||
| @@ -122,6 +122,7 @@ struct PageTable { | |||
| 122 | * corresponding attribute element is of type `Memory`. | 122 | * corresponding attribute element is of type `Memory`. |
| 123 | */ | 123 | */ |
| 124 | VirtualBuffer<PageInfo> pointers; | 124 | VirtualBuffer<PageInfo> pointers; |
| 125 | VirtualBuffer<u64> blocks; | ||
| 125 | 126 | ||
| 126 | VirtualBuffer<u64> backing_addr; | 127 | VirtualBuffer<u64> backing_addr; |
| 127 | 128 | ||
diff --git a/src/common/scratch_buffer.h b/src/common/scratch_buffer.h index d5961b020..2a98cda53 100644 --- a/src/common/scratch_buffer.h +++ b/src/common/scratch_buffer.h | |||
| @@ -40,8 +40,21 @@ public: | |||
| 40 | ~ScratchBuffer() = default; | 40 | ~ScratchBuffer() = default; |
| 41 | ScratchBuffer(const ScratchBuffer&) = delete; | 41 | ScratchBuffer(const ScratchBuffer&) = delete; |
| 42 | ScratchBuffer& operator=(const ScratchBuffer&) = delete; | 42 | ScratchBuffer& operator=(const ScratchBuffer&) = delete; |
| 43 | ScratchBuffer(ScratchBuffer&&) = default; | 43 | |
| 44 | ScratchBuffer& operator=(ScratchBuffer&&) = default; | 44 | ScratchBuffer(ScratchBuffer&& other) noexcept { |
| 45 | swap(other); | ||
| 46 | other.last_requested_size = 0; | ||
| 47 | other.buffer_capacity = 0; | ||
| 48 | other.buffer.reset(); | ||
| 49 | } | ||
| 50 | |||
| 51 | ScratchBuffer& operator=(ScratchBuffer&& other) noexcept { | ||
| 52 | swap(other); | ||
| 53 | other.last_requested_size = 0; | ||
| 54 | other.buffer_capacity = 0; | ||
| 55 | other.buffer.reset(); | ||
| 56 | return *this; | ||
| 57 | } | ||
| 45 | 58 | ||
| 46 | /// This will only grow the buffer's capacity if size is greater than the current capacity. | 59 | /// This will only grow the buffer's capacity if size is greater than the current capacity. |
| 47 | /// The previously held data will remain intact. | 60 | /// The previously held data will remain intact. |
diff --git a/src/common/settings.cpp b/src/common/settings.cpp index 6cbbea1b2..5972480e5 100644 --- a/src/common/settings.cpp +++ b/src/common/settings.cpp | |||
| @@ -27,8 +27,8 @@ std::string GetTimeZoneString() { | |||
| 27 | std::string location_name; | 27 | std::string location_name; |
| 28 | if (time_zone_index == 0) { // Auto | 28 | if (time_zone_index == 0) { // Auto |
| 29 | #if __cpp_lib_chrono >= 201907L | 29 | #if __cpp_lib_chrono >= 201907L |
| 30 | const struct std::chrono::tzdb& time_zone_data = std::chrono::get_tzdb(); | ||
| 31 | try { | 30 | try { |
| 31 | const struct std::chrono::tzdb& time_zone_data = std::chrono::get_tzdb(); | ||
| 32 | const std::chrono::time_zone* current_zone = time_zone_data.current_zone(); | 32 | const std::chrono::time_zone* current_zone = time_zone_data.current_zone(); |
| 33 | std::string_view current_zone_name = current_zone->name(); | 33 | std::string_view current_zone_name = current_zone->name(); |
| 34 | location_name = current_zone_name; | 34 | location_name = current_zone_name; |