PageRenderTime 9ms CodeModel.GetById 7ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 0ms

/test/language/gc/test_native_array_collector01.e

http://github.com/tybor/Liberty
Specman e | 73 lines | 42 code | 10 blank | 21 comment | 0 complexity | 7c9d0d71587a6fc5341ee6d5a5102909 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_NATIVE_ARRAY_COLLECTOR01
 5
 6insert
 7   EIFFELTEST_TOOLS
 8   NATIVE_ARRAY_COLLECTOR[STRING]
 9
10create {}
11   make
12
13feature {ANY}
14   make
15      do
16         capacity := 1
17         honeypot := honeypot.calloc(capacity)
18         full_collect
19         assert(flag)
20      end
21
22   mark_native_arrays
23      do
24         flag := True
25      end
26
27   flag: BOOLEAN
28
29   capacity: INTEGER
30
31   honeypot: NATIVE_ARRAY[STRING]
32
33   full_collect
34      local
35         m: MEMORY
36      do
37         generate_garbage
38         m.full_collect
39      end
40
41   generate_garbage
42      local
43         i: INTEGER; s: STRING
44      do
45         from
46            i := 1
47         until
48            i = 10000
49         loop
50            create s.make_from_string("quark           ends here")
51            i := i + 1
52         end
53      end
54
55end -- class TEST_NATIVE_ARRAY_COLLECTOR01
56--
57-- ------------------------------------------------------------------------------------------------------------------------------
58-- Copyright notice below. Please read.
59--
60-- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License,
61-- as published by the Free Software Foundation; either version 2, or (at your option) any later version.
62-- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty
63-- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have
64-- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free
65-- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
66--
67-- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P.       - University of Nancy 1 - FRANCE
68-- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
69--
70-- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
71--
72-- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
73-- ------------------------------------------------------------------------------------------------------------------------------