[ox] Cleanup

This commit is contained in:
Gary Talent 2018-05-03 01:33:47 -05:00
parent 576a05a038
commit a8e1197ad0
2 changed files with 4 additions and 8 deletions

View File

@ -159,12 +159,12 @@ template<typename InodeId_t>
ValErr<InodeId_t> Directory<InodeId_t>::find(PathIterator it) const noexcept {
ValErr<InodeId_t> retval = {0, 1};
auto size = it.nextSize();
auto name = reinterpret_cast<char*>(ox_alloca(size + 1));
auto name = ox_malloca(size + 1, char);
it.next(name, size);
auto buff = m_fs->read(m_inodeId).template to<Buffer>();
for (auto i = buff->iterator(); i.hasNext(); i.next()) {
auto data = i->data();
if (data.valid() && data->name == name) {
if (data.valid() && data->name == name.get()) {
retval = static_cast<InodeId_t>(data->inode);
}
}

View File

@ -27,12 +27,6 @@
void *operator new(std::size_t, void*) noexcept;
namespace ox {
constexpr auto MallocaStackLimit = 1024;
}
/**
* @return an ox::MallocaPtr of the given type pointing to the requested size memory allocation
*/
@ -44,6 +38,8 @@ constexpr auto MallocaStackLimit = 1024;
namespace ox {
constexpr auto MallocaStackLimit = 1024;
/**
* MallocaPtr will automatically cleanup the pointed to address upon
* destruction if the size of the allocation is greater than MallocaStackLimit.