source: to-imperative/trunk/runtime/rf_common.cc @ 147

Last change on this file since 147 was 147, checked in by orlov, 18 years ago

First working version after rewriting pxx

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.6 KB
Line 
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
27namespace rfrt
28{
29
30uintptr_t heap_size = default_heap_size ;
31uintptr_t stack_size = default_stack_size ;
32pxx::HeapAllocator allocator (heap_start, default_heap_size) ;
33
34#if DEBUG
35uintptr_t empty_copy = 0;
36uintptr_t lt_copy = 0;
37uintptr_t rt_copy = 0;
38uintptr_t both_copy = 0;
39#endif
40
41class Init
42{
43
44public:
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
65Init init ;
66
67}
Note: See TracBrowser for help on using the repository browser.