PageRenderTime 6ms CodeModel.GetById 1ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 1ms

/test/language/gc/test_free2.e

http://github.com/tybor/Liberty
Specman e | 97 lines | 59 code | 5 blank | 33 comment | 0 complexity | 223ef693bd4db4985d0cac706245acdd MD5 | raw file
 1-- This file is part of SmartEiffel The GNU Eiffel Compiler Tools and Libraries.
 2-- See the Copyright notice at the end of this file.
 3--
 4class TEST_FREE2
 5   -- From philippe Coucaud <Philippe.Coucaud@telelogic.com>
 6
 7insert
 8   MEMORY
 9
10create {}
11   make
12
13feature {ANY}
14   scale_factor: INTEGER 1
15         -- 3
16         -- 2
17         -- 1 -> 38Mo
18
19   make
20      local
21         d0, d1, d2: ARRAY[ARRAY[REAL_64]]; a: ARRAY[REAL_64]; i, j: INTEGER
22      do
23         from
24            j := 200
25         until
26            j < 0
27         loop
28            -- allocate medium and big size RSOC
29            from
30               i := 30 * scale_factor
31               create d0.make(1, 0)
32               create d1.make(1, 0)
33            until
34               i < 1
35            loop
36               create a.make(0, 33777)
37               -- requires a big chunk
38               d0.add_last(a)
39               create a.make(0, 2711) -- should fit in a 32K RSOC
40               d1.add_last(a)
41               i := i - 1
42            end
43            create d0.make(1, 0)
44            -- forget previous d0
45            -- allocate small and medium size RSOC
46            from
47               i := 40 * scale_factor
48               create d1.make(1, 0)
49               create d2.make(1, 0)
50            until
51               i < 1
52            loop
53               create a.make(0, 1971)
54               -- should fit in a 32K RSOC
55               d1.add_last(a)
56               create a.make(0, 357)
57               d2.add_last(a)
58               i := i - 1
59            end
60            create d1.make(1, 0) -- forget previous d1
61            create d2.make(1, 0)
62            -- forget previous d2
63            -- allocate big RSOC again
64            from
65               i := 30 * scale_factor
66               create d0.make(1, 0)
67            until
68               i < 1
69            loop
70               create a.make(0, 35001)
71               -- should fit in a 32K RSOC
72               d0.add_last(a)
73               i := i - 1
74            end
75            j := j - 1
76         end
77      end
78
79end -- class TEST_FREE2
80--
81-- ------------------------------------------------------------------------------------------------------------------------------
82-- Copyright notice below. Please read.
83--
84-- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License,
85-- as published by the Free Software Foundation; either version 2, or (at your option) any later version.
86-- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty
87-- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have
88-- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free
89-- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
90--
91-- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P.       - University of Nancy 1 - FRANCE
92-- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
93--
94-- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
95--
96-- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
97-- ------------------------------------------------------------------------------------------------------------------------------