1 //////////////////////////////////////////////////////////////////////////////
4 // ADLib, Prop and their related set of tools and documentation are in the
5 // public domain. The author(s) of this software reserve no copyrights on
6 // the source code and any code generated using the tools. You are encouraged
7 // to use ADLib and Prop to develop software, in both academic and commercial
8 // settings, and are free to incorporate any part of ADLib and Prop into
11 // Although you are under no obligation to do so, we strongly recommend that
12 // you give away all software developed using our tools.
14 // We also ask that credit be given to us when ADLib and/or Prop are used in
15 // your programs, and that this notice be preserved intact in all the source
18 // This software is still under development and we welcome any suggestions
19 // and help from the users.
23 //////////////////////////////////////////////////////////////////////////////
25 #include <AD/memory/blacklistmem.h>
26 #include <AD/gc/gcheaps.h>
28 //////////////////////////////////////////////////////////////////////////////
29 // Constructor and destructor
30 //////////////////////////////////////////////////////////////////////////////
31 BlacklistMem:: BlacklistMem(Mem
& m
) : Mem("BlacklistMem"), mem(m
) {}
32 BlacklistMem::~BlacklistMem() {}
34 //////////////////////////////////////////////////////////////////////////////
36 //////////////////////////////////////////////////////////////////////////////
37 void BlacklistMem::error(const char message
[]) const { mem
.error(message
); }
39 //////////////////////////////////////////////////////////////////////////////
40 // Methods for allocation/deallocation
41 //////////////////////////////////////////////////////////////////////////////
42 void * BlacklistMem::m_alloc(size_t n
)
43 { void * p
= mem
.m_alloc(n
);
47 void * BlacklistMem::c_alloc(size_t n
)
48 { void * p
= mem
.c_alloc(n
);
52 void BlacklistMem::clear() { mem
.clear(); }
53 void BlacklistMem::free(void * p
)
55 { size_t n
= mem
.size(p
);
61 size_t BlacklistMem::size(const void * p
) const { return mem
.size(p
); }
62 size_t BlacklistMem::bytes_used() const { return mem
.bytes_used(); }
63 size_t BlacklistMem::init_page_size(size_t n
) const { return mem
.init_page_size(n
); }
64 size_t BlacklistMem::max_size(size_t n
) const { return mem
.max_size(n
); }