SciresM
64c6ef2de7
fs: reduce path size 0x28 -> 0x18
...
This implements two optimizations on fs::Path, which N added in 12.0.0.
The current structure looks like:
```cpp
struct Path {
const char *m_str; // Points to the read-only path string
char *m_write_buffer_buffer; // Part of std::unique_ptr<char[], ams::fs::impl::Deleter>
ams::fs::impl::Deleter m_write_buffer_deleter; // Parse of std::unique_ptr<char[], ams::fs::impl::Deleter>, stores the size of the buffer.
size_t m_write_buffer_length; // Copy of the write buffer's size accessible to the Path() structure.
bool m_is_normalized; // Whether the path buffer is normalized
};
```
This is pretty wasteful. The write buffer size is stored twice, wasting 8 bytes, because one copy of the size isn't accessible to the path.
In addition, due to alignment, the bool wastes 7 padding bytes.
This commit:
* Encodes normalized in the low bit of the write buffer length, saving 8 bytes.
* Use a custom WriteBuffer class rather than generic unique_ptr, to avoid needing to store the WriteBuffer twice.
These each save 8 bytes, for a final size of 0x18 rather than 0x28.
2022-03-24 20:22:47 -07:00
..
2022-03-21 17:21:44 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 12:59:10 -07:00
2022-03-21 17:21:44 -07:00
2022-03-21 17:21:44 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 12:59:10 -07:00
2022-03-21 17:21:44 -07:00
2022-03-21 17:21:44 -07:00
2022-03-21 17:21:44 -07:00
2021-10-10 18:22:32 -07:00
2022-03-23 09:10:50 -07:00
2021-10-04 12:59:10 -07:00
2022-03-23 09:10:50 -07:00
2022-03-24 20:22:47 -07:00
2022-03-24 08:43:40 -07:00
2022-03-24 16:21:03 -07:00
2022-03-23 09:10:50 -07:00
2022-03-23 09:10:50 -07:00
2021-10-04 12:59:10 -07:00
2022-03-23 09:10:50 -07:00
2022-03-23 09:10:50 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 12:59:10 -07:00
2022-03-23 09:10:50 -07:00
2021-10-07 17:44:54 -07:00
2022-03-21 17:21:44 -07:00
2022-03-23 09:10:50 -07:00
2021-10-04 12:59:10 -07:00
2021-10-17 02:39:16 -07:00
2022-03-23 09:10:50 -07:00
2022-03-21 17:21:44 -07:00
2022-03-23 09:10:50 -07:00
2021-10-04 12:59:10 -07:00
2022-03-23 09:10:50 -07:00
2021-10-04 12:59:10 -07:00
2022-03-21 17:21:44 -07:00
2022-03-21 17:21:44 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 12:59:10 -07:00
2022-03-23 09:10:50 -07:00
2021-10-04 12:59:10 -07:00
2022-03-23 09:10:50 -07:00
2022-03-21 17:21:44 -07:00
2022-03-23 09:10:50 -07:00
2022-03-23 09:10:50 -07:00
2021-02-24 04:06:54 -08:00
2021-10-04 12:59:10 -07:00
2022-03-23 09:10:50 -07:00
2022-03-21 17:21:44 -07:00
2021-10-11 19:01:27 -07:00
2022-03-21 17:21:44 -07:00
2022-03-23 09:10:50 -07:00
2022-03-21 17:21:44 -07:00
2021-11-03 23:56:25 -07:00
2022-03-23 09:10:50 -07:00
2021-10-04 12:59:10 -07:00
2021-10-25 17:31:14 -07:00
2021-11-06 18:19:34 -07:00
2022-03-21 17:21:44 -07:00
2022-03-23 09:10:50 -07:00
2021-10-04 12:59:10 -07:00
2022-03-23 09:10:50 -07:00
2021-12-13 13:07:03 -08:00
2021-10-04 12:59:10 -07:00
2022-03-21 17:21:44 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 12:59:10 -07:00
2022-03-21 17:21:44 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 12:59:10 -07:00
2022-03-24 13:31:49 -07:00
2022-03-21 17:21:44 -07:00
2022-03-21 17:21:44 -07:00
2022-03-21 17:21:44 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 12:59:10 -07:00
2021-10-07 17:44:54 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 12:59:10 -07:00
2022-03-21 17:21:44 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 12:59:10 -07:00
2022-03-23 09:10:50 -07:00
2021-10-04 12:59:10 -07:00
2021-10-09 14:49:53 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 17:34:16 -07:00
2021-10-04 12:59:10 -07:00
2022-03-21 17:21:44 -07:00
2021-10-10 12:57:36 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 12:59:10 -07:00
2021-10-04 12:59:10 -07:00
2022-03-21 17:21:44 -07:00