1 | ////////////////////////////////////////////////////////////////////////////// |
2 | // |
3 | // (C) Copyright Ion Gaztanaga 2012-2013. 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 | |
11 | #define BOOST_CONTAINER_SOURCE |
12 | #include <boost/container/detail/dlmalloc.hpp> |
13 | |
14 | namespace boost{ |
15 | namespace container{ |
16 | |
17 | BOOST_CONTAINER_DECL size_t dlmalloc_size(const void *p) |
18 | { return boost_cont_size(p); } |
19 | |
20 | BOOST_CONTAINER_DECL void* dlmalloc_malloc(size_t bytes) |
21 | { return boost_cont_malloc(bytes); } |
22 | |
23 | BOOST_CONTAINER_DECL void dlmalloc_free(void* mem) |
24 | { return boost_cont_free(mem); } |
25 | |
26 | BOOST_CONTAINER_DECL void* dlmalloc_memalign(size_t bytes, size_t alignment) |
27 | { return boost_cont_memalign(bytes, alignment); } |
28 | |
29 | BOOST_CONTAINER_DECL int dlmalloc_multialloc_nodes |
30 | (size_t n_elements, size_t elem_size, size_t contiguous_elements, boost_cont_memchain *pchain) |
31 | { return boost_cont_multialloc_nodes(n_elements, elem_size, contiguous_elements, pchain); } |
32 | |
33 | BOOST_CONTAINER_DECL int dlmalloc_multialloc_arrays |
34 | (size_t n_elements, const size_t *sizes, size_t sizeof_element, size_t contiguous_elements, boost_cont_memchain *pchain) |
35 | { return boost_cont_multialloc_arrays(n_elements, sizes, sizeof_element, contiguous_elements, pchain); } |
36 | |
37 | BOOST_CONTAINER_DECL void dlmalloc_multidealloc(boost_cont_memchain *pchain) |
38 | { return boost_cont_multidealloc(pchain); } |
39 | |
40 | BOOST_CONTAINER_DECL size_t () |
41 | { return boost_cont_footprint(); } |
42 | |
43 | BOOST_CONTAINER_DECL size_t dlmalloc_allocated_memory() |
44 | { return boost_cont_allocated_memory(); } |
45 | |
46 | BOOST_CONTAINER_DECL size_t dlmalloc_chunksize(const void *p) |
47 | { return boost_cont_chunksize(p); } |
48 | |
49 | BOOST_CONTAINER_DECL int dlmalloc_all_deallocated() |
50 | { return boost_cont_all_deallocated(); } |
51 | |
52 | BOOST_CONTAINER_DECL boost_cont_malloc_stats_t dlmalloc_malloc_stats() |
53 | { return boost_cont_malloc_stats(); } |
54 | |
55 | BOOST_CONTAINER_DECL size_t dlmalloc_in_use_memory() |
56 | { return boost_cont_in_use_memory(); } |
57 | |
58 | BOOST_CONTAINER_DECL int dlmalloc_trim(size_t pad) |
59 | { return boost_cont_trim(pad); } |
60 | |
61 | BOOST_CONTAINER_DECL int dlmalloc_mallopt(int parameter_number, int parameter_value) |
62 | { return boost_cont_mallopt(parameter_number, parameter_value); } |
63 | |
64 | BOOST_CONTAINER_DECL int dlmalloc_grow |
65 | (void* oldmem, size_t minbytes, size_t maxbytes, size_t *received) |
66 | { return boost_cont_grow(oldmem, minbytes, maxbytes, received); } |
67 | |
68 | BOOST_CONTAINER_DECL int dlmalloc_shrink |
69 | (void* oldmem, size_t minbytes, size_t maxbytes, size_t *received, int do_commit) |
70 | { return boost_cont_shrink(oldmem, minbytes, maxbytes, received, do_commit); } |
71 | |
72 | BOOST_CONTAINER_DECL void* dlmalloc_alloc |
73 | (size_t minbytes, size_t preferred_bytes, size_t *received_bytes) |
74 | { return boost_cont_alloc(minbytes, preferred_bytes, received_bytes); } |
75 | |
76 | BOOST_CONTAINER_DECL int dlmalloc_malloc_check() |
77 | { return boost_cont_malloc_check(); } |
78 | |
79 | BOOST_CONTAINER_DECL boost_cont_command_ret_t dlmalloc_allocation_command |
80 | ( allocation_type command |
81 | , size_t sizeof_object |
82 | , size_t limit_objects |
83 | , size_t preferred_objects |
84 | , size_t *received_objects |
85 | , void *reuse_ptr |
86 | ) |
87 | { return boost_cont_allocation_command(command, sizeof_object, limit_objects, preferred_objects, received_objects, reuse_ptr); } |
88 | |
89 | BOOST_CONTAINER_DECL void *dlmalloc_sync_create() |
90 | { return boost_cont_sync_create(); } |
91 | |
92 | BOOST_CONTAINER_DECL void dlmalloc_sync_destroy(void *sync) |
93 | { return boost_cont_sync_destroy(sync); } |
94 | |
95 | BOOST_CONTAINER_DECL bool dlmalloc_sync_lock(void *sync) |
96 | { return boost_cont_sync_lock(sync) != 0; } |
97 | |
98 | BOOST_CONTAINER_DECL void dlmalloc_sync_unlock(void *sync) |
99 | { return boost_cont_sync_unlock(sync); } |
100 | |
101 | BOOST_CONTAINER_DECL bool dlmalloc_global_sync_lock() |
102 | { return boost_cont_global_sync_lock() != 0; } |
103 | |
104 | BOOST_CONTAINER_DECL void dlmalloc_global_sync_unlock() |
105 | { return boost_cont_global_sync_unlock(); } |
106 | |
107 | } //namespace container{ |
108 | } //namespace boost{ |
109 | |