xo-interpreter2 stack: define-expr's work at top-level
This commit is contained in:
parent
66492c1d99
commit
b64dee41cb
2 changed files with 22 additions and 3 deletions
|
|
@ -84,6 +84,19 @@ namespace xo {
|
|||
}
|
||||
}
|
||||
|
||||
bool
|
||||
DArray::resize(size_type new_z) noexcept {
|
||||
if (new_z >= capacity_) {
|
||||
return false;
|
||||
} else if (new_z > size_) {
|
||||
// ensure new size is zeroed (we/re not zeroing if/when we shrink)
|
||||
::memset((std::byte *)(&elts_[size_]), 0, (std::byte *)(&elts_[new_z]) - (std::byte *)(&elts_[size_]));
|
||||
}
|
||||
|
||||
this->size_ = new_z;
|
||||
return true;
|
||||
}
|
||||
|
||||
// printing support
|
||||
|
||||
bool
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue