Commit Graph

9 Commits

Author SHA1 Message Date
Wunkolo
1a8068b151 [Base] Add user-literals for several memory sizes
Rather than using `n * 1024 * 1024`, this adds a convenient `_MiB`/`_KiB` user-literal to the new `literals.h` header to concisely describe units of memory in a much more readable way. Any other useful literals can be added to this header. These literals exist in the `xe::literals` namespace so they are opt-in, similar to `std::chrono` literals, and require a `using namespace xe::literals` statement to utilize it within the current scope.

I've done a pass through the codebase to replace trivial instances of `1024 * 1024 * ...` expressions being used but avoided anything that added additional casting complexity from `size_t` to `uint32_t` and such to keep this commit concise.
2022-01-02 11:51:31 -06:00
Conrad Kramer
2962a266b5 Fix xenia-core build on macOS 2021-10-25 00:48:53 +03:00
Joel Linn
86722be9ca [Base] Make Arena alignment aware
- Add align parameter
- Templated Alloc() implicitly aligns type correctly
- Rewind may leak padding that was added due to alignment
2021-06-02 22:28:43 -05:00
Ben Vanik
e6461f326c Some xb style cleanup. 2015-08-05 22:06:20 -07:00
Ben Vanik
b0425f7ee2 Moving source map to Function. 2015-08-01 14:07:13 -07:00
Ben Vanik
fb1f4906d9 xb format --all (we are now format clean). Buildbot will yell at you. 2015-06-22 22:26:51 -07:00
Drew DeVault
a064ba053e Add missing includes for cstring 2015-06-16 23:16:18 -06:00
Ben Vanik
56a4620cdf Switching StringBuffer to use a raw pointer. 2015-06-10 00:24:17 -07:00
Ben Vanik
e3220f7ae6 Code cleanup: moving poly/ into xenia/base/ 2015-05-02 03:42:51 -07:00