/[eiffelstudio]/trunk/eweasel/tests/runtime022/value.e
ViewVC logotype

Contents of /trunk/eweasel/tests/runtime022/value.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 102126 - (show annotations)
Tue Sep 4 05:48:38 2018 UTC (13 months, 1 week ago) by alexk
File size: 1050 byte(s)
Changed a call to `do_nothing` that might be inlined in finalized mode to a call to a feature that actually uses an object (to check that the object is valid, like in test#runtime023).
1 expanded class
2 VALUE
3
4 inherit
5 COMPARABLE
6 redefine
7 default_create
8 end
9
10 feature {NONE} -- Creation
11
12 default_create
13 -- Initialize with a default value.
14 do
15 create item
16 end
17
18 feature {VALUE} -- Access
19
20 item: TEST
21 -- An object that is moved during GC.
22
23 feature -- Comparison
24
25 is_less alias "<" (other: VALUE): BOOLEAN
26 -- <Precursor>
27 do
28 -- Trigger GC to move `other.item`.
29 ;(create {MEMORY}).full_collect
30 -- Access `other.item`.
31 other.report
32 other.item.f
33 end
34
35 feature -- Output
36
37 report
38 -- Report whether `item` is a valid object rather than a forwarded reference.
39 do
40 io.put_boolean (not is_forwarded ($item))
41 io.put_new_line
42 end
43
44 feature {NONE} -- Run-time
45
46 is_forwarded (p: POINTER): BOOLEAN
47 -- Does `p` of type "EIF_REFERENCE *" have "B_FWD" flag set?
48 external
49 "C inline use %"eif_eiffel.h%""
50 alias
51 "[
52 #if defined(EIF_IL_DLL) || !defined(ISE_GC)
53 return EIF_FALSE;
54 #else
55 return EIF_TEST(((union overhead *) $p - 1)->ov_size & B_FWD);
56 #endif
57 ]"
58 end
59
60 end

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.23