source:
proiecte/swift/trunk/lib/hoard-371/src/heaplayers/fixedsizeheap.h
@
176
Last change on this file since 176 was 176, checked in by , 14 years ago | |
---|---|
File size: 416 bytes |
Line | |
---|---|
1 | #ifndef _FIXEDSIZEHEAP_H_ |
2 | #define _FIXEDSIZEHEAP_H_ |
3 | |
4 | |
5 | template <class SH, int Size> |
6 | class FixedSizeHeap : public SH { |
7 | public: |
8 | inline void * malloc (size_t sz) { |
9 | assert (sz <= Size); |
10 | //printf ("malloc\n"); |
11 | return SH::malloc (Size); |
12 | } |
13 | inline void free (void * ptr) { |
14 | //printf ("free\n"); |
15 | SH::free (ptr); |
16 | } |
17 | protected: |
18 | inline static size_t size (void * p) { |
19 | return Size; |
20 | } |
21 | }; |
22 | |
23 | #endif |
Note: See TracBrowser
for help on using the repository browser.