xref: /aosp_15_r20/external/libchrome/mojo/public/cpp/bindings/lib/fixed_buffer.cc (revision 635a864187cb8b6c713ff48b7e790a6b21769273)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "mojo/public/cpp/bindings/lib/fixed_buffer.h"
6 
7 #include <stdlib.h>
8 
9 #include "mojo/public/cpp/bindings/lib/bindings_internal.h"
10 
11 namespace mojo {
12 namespace internal {
13 
FixedBufferForTesting(size_t size)14 FixedBufferForTesting::FixedBufferForTesting(size_t size)
15     : Buffer(calloc(Align(size), 1), Align(size), 0) {}
16 
~FixedBufferForTesting()17 FixedBufferForTesting::~FixedBufferForTesting() {
18   free(data());
19 }
20 
21 }  // namespace internal
22 }  // namespace mojo
23