• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
dlmalloc_size(const void * p)17 BOOST_CONTAINER_DECL size_t dlmalloc_size(const void *p)
18 {  return boost_cont_size(p);  }
19 
dlmalloc_malloc(size_t bytes)20 BOOST_CONTAINER_DECL void* dlmalloc_malloc(size_t bytes)
21 {  return boost_cont_malloc(bytes);  }
22 
dlmalloc_free(void * mem)23 BOOST_CONTAINER_DECL void  dlmalloc_free(void* mem)
24 {  return boost_cont_free(mem);  }
25 
dlmalloc_memalign(size_t bytes,size_t alignment)26 BOOST_CONTAINER_DECL void* dlmalloc_memalign(size_t bytes, size_t alignment)
27 {  return boost_cont_memalign(bytes, alignment);  }
28 
dlmalloc_multialloc_nodes(size_t n_elements,size_t elem_size,size_t contiguous_elements,boost_cont_memchain * pchain)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 
dlmalloc_multialloc_arrays(size_t n_elements,const size_t * sizes,size_t sizeof_element,size_t contiguous_elements,boost_cont_memchain * pchain)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 
dlmalloc_multidealloc(boost_cont_memchain * pchain)37 BOOST_CONTAINER_DECL void dlmalloc_multidealloc(boost_cont_memchain *pchain)
38 {  return boost_cont_multidealloc(pchain); }
39 
dlmalloc_footprint()40 BOOST_CONTAINER_DECL size_t dlmalloc_footprint()
41 {  return boost_cont_footprint(); }
42 
dlmalloc_allocated_memory()43 BOOST_CONTAINER_DECL size_t dlmalloc_allocated_memory()
44 {  return boost_cont_allocated_memory(); }
45 
dlmalloc_chunksize(const void * p)46 BOOST_CONTAINER_DECL size_t dlmalloc_chunksize(const void *p)
47 {  return boost_cont_chunksize(p); }
48 
dlmalloc_all_deallocated()49 BOOST_CONTAINER_DECL int dlmalloc_all_deallocated()
50 {  return boost_cont_all_deallocated(); }
51 
dlmalloc_malloc_stats()52 BOOST_CONTAINER_DECL boost_cont_malloc_stats_t dlmalloc_malloc_stats()
53 {  return boost_cont_malloc_stats(); }
54 
dlmalloc_in_use_memory()55 BOOST_CONTAINER_DECL size_t dlmalloc_in_use_memory()
56 {  return boost_cont_in_use_memory(); }
57 
dlmalloc_trim(size_t pad)58 BOOST_CONTAINER_DECL int dlmalloc_trim(size_t pad)
59 {  return boost_cont_trim(pad); }
60 
dlmalloc_mallopt(int parameter_number,int parameter_value)61 BOOST_CONTAINER_DECL int dlmalloc_mallopt(int parameter_number, int parameter_value)
62 {  return boost_cont_mallopt(parameter_number, parameter_value); }
63 
dlmalloc_grow(void * oldmem,size_t minbytes,size_t maxbytes,size_t * received)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 
dlmalloc_shrink(void * oldmem,size_t minbytes,size_t maxbytes,size_t * received,int do_commit)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 
dlmalloc_alloc(size_t minbytes,size_t preferred_bytes,size_t * received_bytes)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 
dlmalloc_malloc_check()76 BOOST_CONTAINER_DECL int dlmalloc_malloc_check()
77 {  return boost_cont_malloc_check(); }
78 
dlmalloc_allocation_command(allocation_type command,size_t sizeof_object,size_t limit_objects,size_t preferred_objects,size_t * received_objects,void * reuse_ptr)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 
dlmalloc_sync_create()89 BOOST_CONTAINER_DECL void *dlmalloc_sync_create()
90 {  return boost_cont_sync_create();  }
91 
dlmalloc_sync_destroy(void * sync)92 BOOST_CONTAINER_DECL void dlmalloc_sync_destroy(void *sync)
93 {  return boost_cont_sync_destroy(sync);  }
94 
dlmalloc_sync_lock(void * sync)95 BOOST_CONTAINER_DECL bool dlmalloc_sync_lock(void *sync)
96 {  return boost_cont_sync_lock(sync) != 0;  }
97 
dlmalloc_sync_unlock(void * sync)98 BOOST_CONTAINER_DECL void dlmalloc_sync_unlock(void *sync)
99 {  return boost_cont_sync_unlock(sync);  }
100 
dlmalloc_global_sync_lock()101 BOOST_CONTAINER_DECL bool dlmalloc_global_sync_lock()
102 {  return boost_cont_global_sync_lock() != 0;  }
103 
dlmalloc_global_sync_unlock()104 BOOST_CONTAINER_DECL void dlmalloc_global_sync_unlock()
105 {  return boost_cont_global_sync_unlock();  }
106 
107 }  //namespace container{
108 }  //namespace boost{
109