Debian Codegraph @

ogr/ogrsf_frmts/flatgeobuf/flatbuffers/default_allocator.h

raw symbols SCIP
1 /*
2 * Copyright 2021 Google Inc. All rights reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 #ifndef FLATBUFFERS_DEFAULT_ALLOCATOR_H_
18 #define FLATBUFFERS_DEFAULT_ALLOCATOR_H_cxx . . $ `ogr/ogrsf_frmts/flatgeobuf/flatbuffers/default_allocator.h:18:9`!
19
20 #include "flatbuffers/allocator.h"cxx . . $ `<file>/ogr/ogrsf_frmts/flatgeobuf/flatbuffers/allocator.h`/
21 #include "flatbuffers/base.h"cxx . . $ `<file>/ogr/ogrsf_frmts/flatgeobuf/flatbuffers/base.h`/
22
23 namespace flatbufferscxx . . $ `<built-in>:487:9`! {
24
25 // DefaultAllocator uses new/delete to allocate memory regions
26 class DefaultAllocatorcxx . . $ gdal_flatbuffers/DefaultAllocator# : public Allocatorcxx . . $ gdal_flatbuffers/Allocator# {
27 public:
28 uint8_tcxx . . $ uint8_t# *allocatecxx . . $ gdal_flatbuffers/DefaultAllocator#allocate(4fcce35e481a8fed).(size_t size) FLATBUFFERS_OVERRIDEcxx . . $ `ogr/ogrsf_frmts/flatgeobuf/flatbuffers/base.h:155:11`! {
29 return new uint8_tcxx . . $ uint8_t#[size];
30 }
31
32 void deallocatecxx . . $ gdal_flatbuffers/DefaultAllocator#deallocate(6165b45f45ef689c).(uint8_tcxx . . $ uint8_t# *p, size_t) FLATBUFFERS_OVERRIDEcxx . . $ `ogr/ogrsf_frmts/flatgeobuf/flatbuffers/base.h:155:11`! { delete[] p; }
33
34 static void dealloccxx . . $ gdal_flatbuffers/DefaultAllocator#dealloc(5500c4293b1bbef0).(void *p, size_t) { delete[] static_cast<uint8_tcxx . . $ uint8_t# *>(p); }
35 };
36
37 // These functions allow for a null allocator to mean use the default allocator,
38 // as used by DetachedBuffer and vector_downward below.
39 // This is to avoid having a statically or dynamically allocated default
40 // allocator, or having to move it between the classes that may own it.
41 inline uint8_tcxx . . $ uint8_t# *Allocatecxx . . $ gdal_flatbuffers/Allocate(40a777545fb39ad3).(Allocatorcxx . . $ gdal_flatbuffers/Allocator# *allocator, size_t size) {
42 return allocator ? allocator->allocatecxx . . $ gdal_flatbuffers/Allocator#allocate(4fcce35e481a8fed).(size)
43 : DefaultAllocatorcxx . . $ gdal_flatbuffers/DefaultAllocator#().allocatecxx . . $ gdal_flatbuffers/DefaultAllocator#allocate(4fcce35e481a8fed).(size);
44 }
45
46 inline void Deallocatecxx . . $ gdal_flatbuffers/Deallocate(3a7a7161c6b9b1f).(Allocatorcxx . . $ gdal_flatbuffers/Allocator# *allocator, uint8_tcxx . . $ uint8_t# *p, size_t size) {
47 if (allocator)
48 allocator->deallocatecxx . . $ gdal_flatbuffers/Allocator#deallocate(6165b45f45ef689c).(p, size);
49 else
50 DefaultAllocatorcxx . . $ gdal_flatbuffers/DefaultAllocator#().deallocatecxx . . $ gdal_flatbuffers/DefaultAllocator#deallocate(6165b45f45ef689c).(p, size);
51 }
52
53 inline uint8_tcxx . . $ uint8_t# *ReallocateDownwardcxx . . $ gdal_flatbuffers/ReallocateDownward(536fb391f9da4954).(Allocatorcxx . . $ gdal_flatbuffers/Allocator# *allocator, uint8_tcxx . . $ uint8_t# *old_p,
54 size_t old_size, size_t new_size,
55 size_t in_use_back, size_t in_use_front) {
56 return allocator ? allocator->reallocate_downwardcxx . . $ gdal_flatbuffers/Allocator#reallocate_downward(297995377b2f8aa).(old_p, old_size, new_size,
57 in_use_back, in_use_front)
58 : DefaultAllocatorcxx . . $ gdal_flatbuffers/DefaultAllocator#().reallocate_downwardcxx . . $ gdal_flatbuffers/Allocator#reallocate_downward(297995377b2f8aa).(
59 old_p, old_size, new_size, in_use_back, in_use_front);
60 }
61
62 } // namespace flatbuffers
63
64 #endif // FLATBUFFERS_DEFAULT_ALLOCATOR_H_