C/C++ API Reference
Loading...
Searching...
No Matches
config.h
1// Copyright 2024 The Pigweed Authors
2//
3// Licensed under the Apache License, Version 2.0 (the "License"); you may not
4// use this file except in compliance with the License. You may obtain a copy of
5// the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12// License for the specific language governing permissions and limitations under
13// the License.
14#pragma once
15
16#include <cstdint>
17
18#include "pw_allocator/metrics.h"
19
21
22#ifndef PW_MALLOC_LOCK_TYPE
27#include "pw_allocator/synchronized_allocator.h"
28#define PW_MALLOC_LOCK_TYPE ::pw::allocator::NoSync
29#endif // PW_MALLOC_LOCK_TYPE
30
31#ifndef PW_MALLOC_METRICS_TYPE
35#include "pw_allocator/tracking_allocator.h"
36#define PW_MALLOC_METRICS_TYPE ::pw::allocator::NoMetrics
37
38#elif defined(PW_MALLOC_METRICS_INCLUDE)
39
41#include PW_MALLOC_METRICS_INCLUDE
42
43#endif // PW_MALLOC_METRICS_TYPE
44
45#ifndef PW_MALLOC_BLOCK_OFFSET_TYPE
53#define PW_MALLOC_BLOCK_OFFSET_TYPE uintptr_t
54#endif // PW_MALLOC_BLOCK_OFFSET_TYPE
55
56#ifndef PW_MALLOC_MIN_BUCKET_SIZE
63#define PW_MALLOC_MIN_BUCKET_SIZE 32
64#endif // PW_MALLOC_MIN_BUCKET_SIZE
66 0,
67 "PW_MALLOC_MIN_BUCKET_SIZE must be a power of two");
68
69#ifndef PW_MALLOC_NUM_BUCKETS
76#define PW_MALLOC_NUM_BUCKETS 5
77#endif // PW_MALLOC_NUM_BUCKETS
78
79#ifndef PW_MALLOC_DUAL_FIRST_FIT_THRESHOLD
86#define PW_MALLOC_DUAL_FIRST_FIT_THRESHOLD 2048
87#endif // PW_MALLOC_DUAL_FIRST_FIT_THRESHOLD
#define PW_MALLOC_MIN_BUCKET_SIZE
Definition: config.h:63