1
  
2
  
3
  
4
  
5
  
6
  
7
  
8
  
9
  
10
  
11
  
12
  
13
  
14
  
15
  
16
  
17
  
18
  
19
  
20
  
21
  
22
  
23
  
24
  
25
  
26
  
27
  
28
  
#pike __REAL_VERSION__ 
inherit Tools.Shoot.Test; 
 
constant name="call_out handling (with id)"; 
 
constant m = 5000; /* the target size of the mapping */ 
 
array(function) funs = ({ write, werror, file_stat, Stdio.cp, Array.uniq, master()->compile_error, Stdio.stdin->read, Stdio.stdout->write }); 
 
int perform() 
{ 
   array(array) ids = allocate(m); 
   for (int i=0; i<m; i++) 
   { 
       ids[i] = call_out(funs[i & 7], m+(i*((i&1)*2 - 1))); 
   } 
 
   for (int i = 0; i<m; i++) { 
       find_call_out(ids[i]); 
   } 
 
   for (int i = 0; i<m; i++) { 
       remove_call_out(ids[i]); 
   } 
   return m * 3; 
}