Squashed 'deps/nostalgia/' changes from 227f3cd9..47a6a410

47a6a410 [ox/std] Update Vector memory map for preloader
d82c0822 [buildcore] Add error message to pybb debug for missing debugger

git-subtree-dir: deps/nostalgia
git-subtree-split: 47a6a410c4baabf8700bd271a303232dd2e0d3e9
This commit is contained in:
Gary Talent 2024-05-03 23:42:00 -05:00
parent df22a1e51b
commit bd416f82e2
2 changed files with 4 additions and 6 deletions

View File

@ -98,6 +98,9 @@ def debug(paths: List[str]) -> int:
args = ['gdb', '--args']
elif shutil.which('lldb') is not None:
args = ['lldb', '--']
else:
sys.stderr.write('debug: could not find a supported debugger\n')
return 1
args.extend(paths)
return subprocess.run(args).returncode

View File

@ -19,7 +19,6 @@ namespace ox {
template<typename PlatSpec>
struct VectorMemMap {
const std::size_t smallVecSize = 0; // not a map value
uint8_t allocator = 0;
typename PlatSpec::size_t size = 0;
typename PlatSpec::size_t cap = 0;
typename PlatSpec::PtrType items = 0;
@ -34,10 +33,8 @@ constexpr auto sizeOf(const VectorMemMap<PlatSpec> *t) noexcept {
std::size_t size = 0;
if (t->smallVecSize) {
size += t->smallVecSize;
size += padding(size, PlatSpec::alignOf(t->allocator));
}
size += sizeof(t->allocator);
size += padding(size, PlatSpec::alignOf(t->size));
}
size += sizeof(t->size);
size += padding(size, PlatSpec::alignOf(t->cap));
size += sizeof(t->cap);
@ -67,8 +64,6 @@ constexpr ox::Error pad(Writer_c auto &w, const T *v) noexcept {
template<typename PlatSpec>
constexpr ox::Error serialize(Writer_c auto &w, const VectorMemMap<PlatSpec> &vm) noexcept {
oxReturnError(w.write(nullptr, vm.smallVecSize));
oxReturnError(serialize(w, PlatSpec::correctEndianness(vm.allocator)));
oxReturnError(pad<PlatSpec>(w, &vm.size));
oxReturnError(serialize(w, PlatSpec::correctEndianness(vm.size)));
oxReturnError(serialize(w, PlatSpec::correctEndianness(vm.cap)));
oxReturnError(serialize(w, PlatSpec::correctEndianness(vm.items)));