blob: 14ebe6c6e477ebffbee93cb8b0830c096aa1eee9 [file] [log] [blame]
// Copyright 2020 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <lib/zbitl/decompress.h>
#include <memory>
#include <new>
namespace zbitl {
namespace decompress {
fit::result<std::string_view, std::unique_ptr<std::byte[]>> DefaultAllocator(size_t bytes) {
if (auto ptr = std::make_unique<std::byte[]>(bytes)) {
return fit::ok(std::move(ptr));
}
return fit::error{"out of memory"};
}
} // namespace decompress
} // namespace zbitl