Line | |
---|
1 | #ifndef _FIXEDREQUESTHEAP_H_ |
---|
2 | #define _FIXEDREQUESTHEAP_H_ |
---|
3 | |
---|
4 | /** |
---|
5 | * @class FixedRequestHeap |
---|
6 | * @brief Always grabs the same size, regardless of the request size. |
---|
7 | */ |
---|
8 | |
---|
9 | namespace Hoard { |
---|
10 | |
---|
11 | template <size_t RequestSize, |
---|
12 | class SuperHeap> |
---|
13 | class FixedRequestHeap : public SuperHeap { |
---|
14 | public: |
---|
15 | inline void * malloc (size_t) { |
---|
16 | return SuperHeap::malloc (RequestSize); |
---|
17 | } |
---|
18 | inline static size_t getSize (void *) { |
---|
19 | return RequestSize; |
---|
20 | } |
---|
21 | }; |
---|
22 | |
---|
23 | } |
---|
24 | |
---|
25 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.