Last change
on this file since 146 was
146,
checked in by orlov, 18 years ago
|
* empty log message *
|
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Author Date Id Revision
|
File size:
895 bytes
|
Line | |
---|
1 | // $Source$ |
---|
2 | // $Revision: 146 $ |
---|
3 | // $Date: 2002-08-29 17:48:12 +0000 (Thu, 29 Aug 2002) $ |
---|
4 | |
---|
5 | #ifndef __pxx_heap_hh__ |
---|
6 | #define __pxx_heap_hh__ |
---|
7 | |
---|
8 | #include "pxx_common.hh" |
---|
9 | |
---|
10 | namespace pxx |
---|
11 | { |
---|
12 | |
---|
13 | class Heap |
---|
14 | { |
---|
15 | // |
---|
16 | // heap start address |
---|
17 | void* const start; |
---|
18 | // |
---|
19 | // heap maximum size |
---|
20 | size_t const max_size; |
---|
21 | // |
---|
22 | // an order of maximum size |
---|
23 | size_t const max_order; |
---|
24 | // |
---|
25 | // heap current size |
---|
26 | size_t current_size; |
---|
27 | // |
---|
28 | // an order of current size |
---|
29 | size_t current_order; |
---|
30 | // |
---|
31 | // |
---|
32 | int fd; |
---|
33 | // |
---|
34 | // |
---|
35 | bool need_remap; |
---|
36 | |
---|
37 | public: |
---|
38 | // |
---|
39 | // constructor |
---|
40 | Heap( |
---|
41 | void* const _start, |
---|
42 | size_t const _max_size, |
---|
43 | size_t _init_size = page_size, |
---|
44 | int _fd = 0, |
---|
45 | bool _need_remap = true |
---|
46 | ); |
---|
47 | // |
---|
48 | // destructor |
---|
49 | ~Heap(); |
---|
50 | // |
---|
51 | // expands a heap |
---|
52 | void expand( unsigned _order = 1 ); |
---|
53 | // |
---|
54 | // |
---|
55 | void *get_start() const { return start; } |
---|
56 | // |
---|
57 | // |
---|
58 | size_t get_current_order() const { return current_order; } |
---|
59 | }; |
---|
60 | |
---|
61 | } |
---|
62 | |
---|
63 | #endif // __pxx_heap_hh__ |
---|
64 | |
---|
Note: See
TracBrowser
for help on using the repository browser.