1 | // |
---|
2 | // Copyright (C) 2000 Refal+ Development Group |
---|
3 | // |
---|
4 | // Refal+ is free software; you can redistribute it and/or modify |
---|
5 | // it under the terms of the GNU General Public License as published by |
---|
6 | // the Free Software Foundation; either version 2 of the License, or |
---|
7 | // (at your option) any later version. |
---|
8 | // |
---|
9 | // Refal+ is distributed in the hope that it will be useful, |
---|
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
12 | // GNU General Public License for more details. |
---|
13 | // |
---|
14 | // You should have received a copy of the GNU General Public License |
---|
15 | // along with Refal+; if not, write to the Free Software |
---|
16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
17 | // |
---|
18 | // $Source$ |
---|
19 | // $Revision: 147 $ |
---|
20 | // $Date: 2002-09-01 00:16:12 +0000 (Sun, 01 Sep 2002) $ |
---|
21 | // Author: Andrey Slepuhin <pooh@msu.ru> |
---|
22 | |
---|
23 | #include "rf_common.hh" |
---|
24 | #include "pxx_heap_allocator.hh" |
---|
25 | #include "pxx_memory_chunk.hh" |
---|
26 | |
---|
27 | namespace rfrt |
---|
28 | { |
---|
29 | |
---|
30 | uintptr_t heap_size = default_heap_size ; |
---|
31 | uintptr_t stack_size = default_stack_size ; |
---|
32 | pxx::HeapAllocator allocator (heap_start, default_heap_size) ; |
---|
33 | |
---|
34 | #if DEBUG |
---|
35 | uintptr_t empty_copy = 0; |
---|
36 | uintptr_t lt_copy = 0; |
---|
37 | uintptr_t rt_copy = 0; |
---|
38 | uintptr_t both_copy = 0; |
---|
39 | #endif |
---|
40 | |
---|
41 | class Init |
---|
42 | { |
---|
43 | |
---|
44 | public: |
---|
45 | |
---|
46 | Init () |
---|
47 | {} |
---|
48 | |
---|
49 | ~Init () |
---|
50 | { |
---|
51 | #if DEBUG |
---|
52 | printf("Concatenation statistics:\n"); |
---|
53 | printf("- no copy: %u\n", empty_copy); |
---|
54 | printf("- left copy: %u\n", lt_copy); |
---|
55 | printf("- right copy: %u\n", rt_copy); |
---|
56 | printf("- both copy: %u\n", both_copy); |
---|
57 | #if PARANOIA |
---|
58 | allocator.memory_dump<pxx::Memory_Chunk>(); |
---|
59 | #endif // PARANOIA |
---|
60 | #endif // DEBUG |
---|
61 | } |
---|
62 | |
---|
63 | }; |
---|
64 | |
---|
65 | Init init ; |
---|
66 | |
---|
67 | } |
---|