You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Attempt allocation: allocate 1024 bytes. We should fill up the heap by 10 allocations or fewer (some plans reserves more memory, such as semispace and generational GCs)
16
+
letmut last_result = crate::util::Address::MAX;
17
+
18
+
// Attempt allocation: allocate 1024 bytes. We should fill up the heap by 1024 allocations or fewer (some plans reserves more memory, such as semispace and generational GCs)
17
19
// Run a few more times to test if we set/unset no_gc_on_fail properly.
18
-
for _ in0..20{
19
-
let addr = memory_manager::alloc_no_gc(
20
+
for _ in0..1100{
21
+
last_result = memory_manager::alloc_no_gc(
20
22
&mut fixture.mutator,
21
23
1024,
22
24
8,
23
25
0,
24
26
AllocationSemantics::Default,
25
27
);
26
-
ifaddr.is_zero(){
28
+
iflast_result.is_zero(){
27
29
read_mockvm(|mock| {
28
30
assert!(!mock.block_for_gc.is_called());
29
31
});
32
+
read_mockvm(|mock| {
33
+
assert!(!mock.out_of_memory.is_called());
34
+
});
30
35
}
31
36
}
37
+
38
+
// The allocation should consume all the heap, and the last result should be zero (failure).
0 commit comments