14#ifndef NEVERFREEMEMORY_H
15#define NEVERFREEMEMORY_H
32class EXPCL_DTOOL_DTOOLBASE NeverFreeMemory {
37 INLINE
static void *
alloc(
size_t size);
45 void *ns_alloc(
size_t size);
46 INLINE
static NeverFreeMemory *get_global_ptr();
47 static void make_global_ptr();
52 INLINE Page(
void *start,
size_t size);
53 INLINE
bool operator < (
const Page &other)
const;
54 INLINE
void *
alloc(
size_t size);
60 typedef std::set<Page> Pages;
66 static NeverFreeMemory * TVOLATILE _global_ptr;
static size_t get_total_used()
Returns the total number of bytes requested by the application in calls to NeverFreeMemory::alloc().
static size_t get_total_alloc()
Returns the total number of bytes consumed by all the pages allocated internally by this object.
static void * alloc(size_t size)
Returns a pointer to a newly-allocated block of memory of the indicated size.
static size_t get_total_unused()
Returns the difference between get_total_alloc() and get_total_used().
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.