1 /*
2  * %CopyrightBegin%
3  *
4  * Copyright Ericsson AB 2003-2016. All Rights Reserved.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *     http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  * %CopyrightEnd%
19  */
20 
21 
22 #ifndef ERL_AFIT_ALLOC__
23 #define ERL_AFIT_ALLOC__
24 
25 #include "erl_alloc_util.h"
26 
27 #define ERTS_ALC_AF_ALLOC_VSN_STR "0.9"
28 
29 typedef struct AFAllctr_t_ AFAllctr_t;
30 
31 typedef struct {
32     int dummy;
33 } AFAllctrInit_t;
34 
35 #define ERTS_DEFAULT_AF_ALLCTR_INIT {                                      \
36     0					/* dummy                         */\
37 }
38 
39 void erts_afalc_init(void);
40 Allctr_t *erts_afalc_start(AFAllctr_t *, AFAllctrInit_t *, AllctrInit_t *);
41 
42 #endif /* #ifndef ERL_BESTFIT_ALLOC__ */
43 
44 
45 
46 #if defined(GET_ERL_AF_ALLOC_IMPL) && !defined(ERL_AF_ALLOC_IMPL__)
47 #define ERL_AF_ALLOC_IMPL__
48 
49 #define GET_ERL_ALLOC_UTIL_IMPL
50 #include "erl_alloc_util.h"
51 
52 typedef struct AFFreeBlock_t_ AFFreeBlock_t;
53 
54 struct AFAllctr_t_ {
55     Allctr_t		allctr; /* Has to be first! */
56 
57     AFFreeBlock_t *	free_list;
58 };
59 
60 UWord erts_afalc_test(UWord, UWord, UWord);
61 
62 #endif /* #if defined(GET_ERL_AF_ALLOC_IMPL)
63 	      && !defined(ERL_AF_ALLOC_IMPL__) */
64