dlmalloc.hpp 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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. #ifndef BOOST_CONFIG_HPP
  13. # include <boost/config.hpp>
  14. #endif
  15. #if defined(BOOST_HAS_PRAGMA_ONCE)
  16. # pragma once
  17. #endif
  18. #include <boost/container/detail/config_begin.hpp>
  19. #include <boost/container/detail/workaround.hpp>
  20. #include <boost/container/detail/auto_link.hpp>
  21. #include <boost/container/detail/alloc_lib.h>
  22. namespace boost{
  23. namespace container{
  24. typedef boost_cont_command_ret_t dlmalloc_command_ret_t;
  25. typedef boost_cont_memchain dlmalloc_memchain;
  26. typedef boost_cont_memchain_it dlmalloc_memchain_it;
  27. typedef boost_cont_malloc_stats_t dlmalloc_malloc_stats_t;
  28. BOOST_CONTAINER_DECL size_t dlmalloc_size(const void *p);
  29. BOOST_CONTAINER_DECL void* dlmalloc_malloc(size_t bytes);
  30. BOOST_CONTAINER_DECL void dlmalloc_free(void* mem);
  31. BOOST_CONTAINER_DECL void* dlmalloc_memalign(size_t bytes, size_t alignment);
  32. BOOST_CONTAINER_DECL int dlmalloc_multialloc_nodes
  33. (size_t n_elements, size_t elem_size, size_t contiguous_elements, boost_cont_memchain *pchain);
  34. BOOST_CONTAINER_DECL int dlmalloc_multialloc_arrays
  35. (size_t n_elements, const size_t *sizes, size_t sizeof_element, size_t contiguous_elements, boost_cont_memchain *pchain);
  36. BOOST_CONTAINER_DECL void dlmalloc_multidealloc(boost_cont_memchain *pchain);
  37. BOOST_CONTAINER_DECL size_t dlmalloc_footprint();
  38. BOOST_CONTAINER_DECL size_t dlmalloc_allocated_memory();
  39. BOOST_CONTAINER_DECL size_t dlmalloc_chunksize(const void *p);
  40. BOOST_CONTAINER_DECL int dlmalloc_all_deallocated();
  41. BOOST_CONTAINER_DECL boost_cont_malloc_stats_t dlmalloc_malloc_stats();
  42. BOOST_CONTAINER_DECL size_t dlmalloc_in_use_memory();
  43. BOOST_CONTAINER_DECL int dlmalloc_trim(size_t pad);
  44. BOOST_CONTAINER_DECL int dlmalloc_mallopt(int parameter_number, int parameter_value);
  45. BOOST_CONTAINER_DECL int dlmalloc_grow(void* oldmem, size_t minbytes, size_t maxbytes, size_t *received);
  46. BOOST_CONTAINER_DECL int dlmalloc_shrink(void* oldmem, size_t minbytes, size_t maxbytes, size_t *received, int do_commit);
  47. BOOST_CONTAINER_DECL void* dlmalloc_alloc(size_t minbytes, size_t preferred_bytes, size_t *received_bytes);
  48. BOOST_CONTAINER_DECL int dlmalloc_malloc_check();
  49. BOOST_CONTAINER_DECL boost_cont_command_ret_t dlmalloc_allocation_command
  50. ( allocation_type command
  51. , size_t sizeof_object
  52. , size_t limit_objects
  53. , size_t preferred_objects
  54. , size_t *received_objects
  55. , void *reuse_ptr
  56. );
  57. BOOST_CONTAINER_DECL int dlmalloc_mallopt(int param_number, int value);
  58. BOOST_CONTAINER_DECL void *dlmalloc_sync_create();
  59. BOOST_CONTAINER_DECL void dlmalloc_sync_destroy(void *sync);
  60. BOOST_CONTAINER_DECL bool dlmalloc_sync_lock(void *sync);
  61. BOOST_CONTAINER_DECL void dlmalloc_sync_unlock(void *sync);
  62. BOOST_CONTAINER_DECL bool dlmalloc_global_sync_lock();
  63. BOOST_CONTAINER_DECL void dlmalloc_global_sync_unlock();
  64. } //namespace container{
  65. } //namespace boost{
  66. #include <boost/container/detail/config_end.hpp>
  67. #endif //BOOST_CONTAINER_DETAIL_ALLOC_LIB_HPP