1 //////////////////////////////////////////////////////////////////////////////
2 //
3 // (C) Copyright Ion Gaztanaga 2015-2015. Distributed under the Boost
4 // Software License, Version 1.0. (See accompanying file
5 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 //
7 // See http://www.boost.org/libs/container for documentation.
8 //
9 //////////////////////////////////////////////////////////////////////////////
10 #ifndef BOOST_CONTAINER_DETAIL_ALLOC_LIB_HPP
11 #define BOOST_CONTAINER_DETAIL_ALLOC_LIB_HPP
12 
13 #ifndef BOOST_CONFIG_HPP
14 #  include <boost/config.hpp>
15 #endif
16 
17 #if defined(BOOST_HAS_PRAGMA_ONCE)
18 #  pragma once
19 #endif
20 
21 #include <boost/container/detail/config_begin.hpp>
22 #include <boost/container/detail/workaround.hpp>
23 #include <boost/container/detail/auto_link.hpp>
24 
25 #include <boost/container/detail/alloc_lib.h>
26 
27 namespace boost{
28 namespace container{
29 
30 typedef boost_cont_command_ret_t dlmalloc_command_ret_t;
31 typedef boost_cont_memchain dlmalloc_memchain;
32 typedef boost_cont_memchain_it dlmalloc_memchain_it;
33 typedef boost_cont_malloc_stats_t dlmalloc_malloc_stats_t;
34 
35 BOOST_CONTAINER_DECL size_t dlmalloc_size(const void *p);
36 
37 BOOST_CONTAINER_DECL void* dlmalloc_malloc(size_t bytes);
38 
39 BOOST_CONTAINER_DECL void  dlmalloc_free(void* mem);
40 
41 BOOST_CONTAINER_DECL void* dlmalloc_memalign(size_t bytes, size_t alignment);
42 
43 BOOST_CONTAINER_DECL int dlmalloc_multialloc_nodes
44    (size_t n_elements, size_t elem_size, size_t contiguous_elements, boost_cont_memchain *pchain);
45 
46 BOOST_CONTAINER_DECL int dlmalloc_multialloc_arrays
47    (size_t n_elements, const size_t *sizes, size_t sizeof_element, size_t contiguous_elements, boost_cont_memchain *pchain);
48 
49 BOOST_CONTAINER_DECL void dlmalloc_multidealloc(boost_cont_memchain *pchain);
50 
51 BOOST_CONTAINER_DECL size_t dlmalloc_footprint();
52 
53 BOOST_CONTAINER_DECL size_t dlmalloc_allocated_memory();
54 
55 BOOST_CONTAINER_DECL size_t dlmalloc_chunksize(const void *p);
56 
57 BOOST_CONTAINER_DECL int dlmalloc_all_deallocated();
58 
59 BOOST_CONTAINER_DECL boost_cont_malloc_stats_t dlmalloc_malloc_stats();
60 
61 BOOST_CONTAINER_DECL size_t dlmalloc_in_use_memory();
62 
63 BOOST_CONTAINER_DECL int dlmalloc_trim(size_t pad);
64 
65 BOOST_CONTAINER_DECL int dlmalloc_mallopt(int parameter_number, int parameter_value);
66 
67 BOOST_CONTAINER_DECL int dlmalloc_grow(void* oldmem, size_t minbytes, size_t maxbytes, size_t *received);
68 
69 BOOST_CONTAINER_DECL int dlmalloc_shrink(void* oldmem, size_t minbytes, size_t maxbytes, size_t *received, int do_commit);
70 
71 BOOST_CONTAINER_DECL void* dlmalloc_alloc(size_t minbytes, size_t preferred_bytes, size_t *received_bytes);
72 
73 BOOST_CONTAINER_DECL int dlmalloc_malloc_check();
74 
75 BOOST_CONTAINER_DECL boost_cont_command_ret_t dlmalloc_allocation_command
76    ( allocation_type command
77    , size_t sizeof_object
78    , size_t limit_objects
79    , size_t preferred_objects
80    , size_t *received_objects
81    , void *reuse_ptr
82    );
83 
84 BOOST_CONTAINER_DECL int dlmalloc_mallopt(int param_number, int value);
85 
86 BOOST_CONTAINER_DECL void *dlmalloc_sync_create();
87 
88 BOOST_CONTAINER_DECL void dlmalloc_sync_destroy(void *sync);
89 
90 BOOST_CONTAINER_DECL bool dlmalloc_sync_lock(void *sync);
91 
92 BOOST_CONTAINER_DECL void dlmalloc_sync_unlock(void *sync);
93 
94 BOOST_CONTAINER_DECL bool dlmalloc_global_sync_lock();
95 
96 BOOST_CONTAINER_DECL void dlmalloc_global_sync_unlock();
97 
98 }  //namespace container{
99 }  //namespace boost{
100 
101 #include <boost/container/detail/config_end.hpp>
102 
103 #endif   //BOOST_CONTAINER_DETAIL_ALLOC_LIB_HPP
104