source: proiecte/swift/trunk/lib/hoard-371/src/fixedrequestheap.h @ 176

Last change on this file since 176 was 176, checked in by (none), 14 years ago
  • imported repo from "guagal"
File size: 452 bytes
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
9namespace Hoard {
10
11template <size_t RequestSize,
12          class SuperHeap>
13class FixedRequestHeap : public SuperHeap {
14public:
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.