xref: /btstack/src/btstack_memory.h (revision bc64ca6239d588879572085f4b3d34c69ad10f49)
1a3b02b71Smatthias.ringwald /*
2a3b02b71Smatthias.ringwald  * Copyright (C) 2011 by Matthias Ringwald
3a3b02b71Smatthias.ringwald  *
4a3b02b71Smatthias.ringwald  * Redistribution and use in source and binary forms, with or without
5a3b02b71Smatthias.ringwald  * modification, are permitted provided that the following conditions
6a3b02b71Smatthias.ringwald  * are met:
7a3b02b71Smatthias.ringwald  *
8a3b02b71Smatthias.ringwald  * 1. Redistributions of source code must retain the above copyright
9a3b02b71Smatthias.ringwald  *    notice, this list of conditions and the following disclaimer.
10a3b02b71Smatthias.ringwald  * 2. Redistributions in binary form must reproduce the above copyright
11a3b02b71Smatthias.ringwald  *    notice, this list of conditions and the following disclaimer in the
12a3b02b71Smatthias.ringwald  *    documentation and/or other materials provided with the distribution.
13a3b02b71Smatthias.ringwald  * 3. Neither the name of the copyright holders nor the names of
14a3b02b71Smatthias.ringwald  *    contributors may be used to endorse or promote products derived
15a3b02b71Smatthias.ringwald  *    from this software without specific prior written permission.
16a3b02b71Smatthias.ringwald  *
17a3b02b71Smatthias.ringwald  * THIS SOFTWARE IS PROVIDED BY MATTHIAS RINGWALD AND CONTRIBUTORS
18a3b02b71Smatthias.ringwald  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19a3b02b71Smatthias.ringwald  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
20a3b02b71Smatthias.ringwald  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MATTHIAS
21a3b02b71Smatthias.ringwald  * RINGWALD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
22a3b02b71Smatthias.ringwald  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23a3b02b71Smatthias.ringwald  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
24a3b02b71Smatthias.ringwald  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
25a3b02b71Smatthias.ringwald  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26a3b02b71Smatthias.ringwald  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
27a3b02b71Smatthias.ringwald  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28a3b02b71Smatthias.ringwald  * SUCH DAMAGE.
29a3b02b71Smatthias.ringwald  *
30a3b02b71Smatthias.ringwald  */
31a3b02b71Smatthias.ringwald 
32a3b02b71Smatthias.ringwald /*
33a3b02b71Smatthias.ringwald  *  btstsack_memory.h
34a3b02b71Smatthias.ringwald  *
35a3b02b71Smatthias.ringwald  *  @brief BTstack memory management via configurable memory pools
36a3b02b71Smatthias.ringwald  *
37a3b02b71Smatthias.ringwald  */
38a3b02b71Smatthias.ringwald 
39a3b02b71Smatthias.ringwald #pragma once
40a3b02b71Smatthias.ringwald 
41*bc64ca62S[email protected] #if defined __cplusplus
42*bc64ca62S[email protected] extern "C" {
43*bc64ca62S[email protected] #endif
44*bc64ca62S[email protected] 
45a3b02b71Smatthias.ringwald void btstack_memory_init(void);
46a3b02b71Smatthias.ringwald 
47a3b02b71Smatthias.ringwald void * btstack_memory_hci_connection_get(void);
48a3b02b71Smatthias.ringwald void   btstack_memory_hci_connection_free(void *hci_connection);
49a3b02b71Smatthias.ringwald void * btstack_memory_l2cap_service_get(void);
50a3b02b71Smatthias.ringwald void   btstack_memory_l2cap_service_free(void *l2cap_service);
51a3b02b71Smatthias.ringwald void * btstack_memory_l2cap_channel_get(void);
52a3b02b71Smatthias.ringwald void   btstack_memory_l2cap_channel_free(void *l2cap_channel);
53a3b02b71Smatthias.ringwald void * btstack_memory_rfcomm_multiplexer_get(void);
54a3b02b71Smatthias.ringwald void   btstack_memory_rfcomm_multiplexer_free(void *rfcomm_multiplexer);
55a3b02b71Smatthias.ringwald void * btstack_memory_rfcomm_service_get(void);
56a3b02b71Smatthias.ringwald void   btstack_memory_rfcomm_service_free(void *rfcomm_service);
57a3b02b71Smatthias.ringwald void * btstack_memory_rfcomm_channel_get(void);
58a3b02b71Smatthias.ringwald void   btstack_memory_rfcomm_channel_free(void *rfcomm_channel);
59e0e5e285Smatthias.ringwald void * btstack_memory_db_mem_device_name_get(void);
60e0e5e285Smatthias.ringwald void   btstack_memory_db_mem_device_name_free(void *db_mem_device_name);
61e0e5e285Smatthias.ringwald void * btstack_memory_db_mem_device_link_key_get(void);
62e0e5e285Smatthias.ringwald void   btstack_memory_db_mem_device_link_key_free(void *db_mem_device_link_key);
63dec1a9baSmatthias.ringwald void * btstack_memory_db_mem_service_get(void);
64dec1a9baSmatthias.ringwald void   btstack_memory_db_mem_service_free(void *db_mem_service);
65*bc64ca62S[email protected] 
66*bc64ca62S[email protected] #if defined __cplusplus
67*bc64ca62S[email protected] }
68*bc64ca62S[email protected] #endif
69