blob: 33a17660e0c5dd3836fcd0a65596cb4f861a34f0 [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 "resizeable_array_buffer.h"
namespace minfs {
zx_status_t ResizeableArrayBuffer::Shrink(size_t block_count) {
ZX_ASSERT(block_count > 0 && block_count <= capacity());
buffer().resize(block_count * BlockSize());
return ZX_OK;
}
zx_status_t ResizeableArrayBuffer::Grow(size_t block_count) {
ZX_ASSERT(block_count >= capacity());
buffer().resize(block_count * BlockSize());
return ZX_OK;
}
} // namespace minfs