36 # include <vcl_msvc_warnings.h> 38 #include "vnl/vnl_export.h" 46 static std::size_t
ROUND_UP(std::size_t bytes) {
56 static obj * free_list[];
66 static void *refill(std::size_t n);
69 static char *chunk_alloc(std::size_t size,
int &nobjs);
94 return (
void*)
new char[n];
96 my_free_list = free_list + FREELIST_INDEX(n);
100 result = *my_free_list;
101 if (result ==
nullptr) {
102 void *r = refill(ROUND_UP(n));
105 *my_free_list = result -> free_list_link;
113 obj * * my_free_list;
119 my_free_list = free_list + FREELIST_INDEX(n);
120 q -> free_list_link = *my_free_list;
124 static void * reallocate(
void *p, std::size_t old_sz, std::size_t new_sz);
127 # endif // vnl_alloc_h_
constexpr std::size_t VNL_ALLOC_NFREELISTS
constexpr std::size_t VNL_ALLOC_MAX_BYTES
static void deallocate(void *p, std::size_t n)
constexpr int VNL_ALLOC_ALIGN
static std::size_t heap_size
static std::size_t ROUND_UP(std::size_t bytes)
union obj * free_list_link
static std::size_t FREELIST_INDEX(std::size_t bytes)
static void * allocate(std::size_t n)