kernel+libluna: Avoid scrubbing when the memory is going to be overwritten anyway
This is the case for objects with constructors and temporary memory which is filled afterwards.
This commit is contained in:
parent
d48142f163
commit
6f3ed70363
@ -12,7 +12,7 @@ Result<u64> sys_poll(Registers*, SyscallArgs args)
|
||||
nfds_t nfds = (nfds_t)args[1];
|
||||
int timeout = (int)args[2];
|
||||
|
||||
struct pollfd* kfds = (struct pollfd*)TRY(malloc_impl(nfds * sizeof(pollfd)));
|
||||
struct pollfd* kfds = (struct pollfd*)TRY(malloc_impl(nfds * sizeof(pollfd), false, false));
|
||||
auto guard = make_scope_guard([kfds] { free_impl(kfds); });
|
||||
|
||||
if (!MemoryManager::copy_from_user(fds, kfds, nfds * sizeof(pollfd))) return err(EFAULT);
|
||||
|
@ -24,7 +24,7 @@
|
||||
*/
|
||||
template <typename T, class... Args> [[nodiscard]] Result<T*> make(Args... args)
|
||||
{
|
||||
T* const result = (T*)TRY(malloc_impl(sizeof(T)));
|
||||
T* const result = (T*)TRY(malloc_impl(sizeof(T), false, false));
|
||||
new (result) T(args...);
|
||||
return result;
|
||||
}
|
||||
|
@ -425,12 +425,12 @@ void dump_heap_usage()
|
||||
#ifdef USE_FREESTANDING
|
||||
void* operator new(usize size, const std::nothrow_t&) noexcept
|
||||
{
|
||||
return malloc_impl(size).value_or(nullptr);
|
||||
return malloc_impl(size, false, false).value_or(nullptr);
|
||||
}
|
||||
|
||||
void* operator new[](usize size, const std::nothrow_t&) noexcept
|
||||
{
|
||||
return malloc_impl(size).value_or(nullptr);
|
||||
return malloc_impl(size, false, false).value_or(nullptr);
|
||||
}
|
||||
|
||||
void operator delete(void* p) noexcept
|
||||
|
Loading…
Reference in New Issue
Block a user