1 /* ====== BEGIN INCLUDE SEGMENT         apl_storage_system_data.incl.pl1 ========================== */
 2 
 3 /*
 4  * This include file contains a declaration of the data structure
 5  * kept in the "map segment" by the apl_storage_mngr_
 6  *
 7  * Written July 1973 by DAM
 8  * Modified Dec 1973 to change spelling of structure name from stroage to storage by PG
 9  */
10 
11           /* data in the map seg */
12 
13 declare
14     1 global_storage_system_data        aligned based (global_storage_system_data_pointer),
15       2 seg_map_hash_table(0:88),                           /* hash table for finding seg_list entry given pointer */
16         3 seg_baseno bit(18) unaligned,                     /* 0 if empty, or segment number */
17         3 seg_list_idx fixed bin(17) unaligned,             /* 0 if empty, or index into seg_list for this seg */
18       2 last_map unaligned pointer,                         /* -> last seg_map in the storage_system_data segment */
19       2 current_little_bead_seg fixed bin,                  /* 0 or index in seg_list of little bead allocation seg. */
20       2 current_big_bead_seg fixed bin,                     /* 0 or index in seg_list of big bead allocation seg. */
21       2 current_little_scan_pos fixed bin,                  /* next map entry to scan in current_little_bead_seg */
22       2 current_big_scan_pos fixed bin,                     /* next map entry to scan in current_big_bead_seg */
23       2 seg_list (30),                                      /* <--- one entry for each segment in use by storage mngr */
24         3 words_free fixed bin(18),                         /* total number of unallocated words in the segment */
25         3 pointer unaligned pointer,                        /* -> seg if usage = 1 or 2, else -> seg_map */
26         3 usage fixed bin,                                  /* 0 = entry free, 1 = seg not currently in use,
27                                                                2 = value_stack seg, 3 = little bead seg, 4 = big bead seg */
28 
29       2 metric,                                             /* METERING DATA, governed by ws_info.meter_mode */
30 
31         3 big_seg_balance,                                  /* meters for balancing of big-bead segs */
32           4 count fixed bin,                                /* number of times a balance occurred */
33           4 thrown_away fixed bin,                          /* number of times a bead had to be thrown away */
34           4 amt_thrown_away fixed bin,                      /* total number of words that had to be thrown away */
35           4 time_spent_balancing fixed bin(71),             /* time spent balancing */
36           4 space_left fixed bin(30),                       /* sum of amounts space left in use by maps after balances */
37         3 little_seg_balance,                               /* same meters for balancing of little-bead segs */
38           4 count fixed bin,
39           4 thrown_away fixed bin,
40           4 space_left fixed bin(30),
41           4 amt_thrown_away fixed bin,
42           4 time_spent_balancing fixed bin(71),
43         3 get_next_value_stack_seg_calls fixed bin,         /* number of times new value stack seg was needed */
44         3 copy_apl_value_calls fixed bin,                   /* number of values copied */
45         3 copy_apl_value_time fixed bin(71),                /* amount of time spent copying values */
46 
47         3 range(16),                                        /* alloc-free meters by size range */
48           4 size fixed bin(18),                             /* number of words have to be as big as to fit in range */
49           4 free_count fixed bin,                           /* number beads this size freed */
50           4 map_free_count fixed bin,                       /* number times freeing required search of map */
51           4 free_time fixed bin(71),                        /* amount of time spent freeing beads this size */
52           4 words_freed fixed bin(24),                      /* total number of words freed in beads this size */
53 
54           4 alloc_count fixed bin,                          /* number beads this size allocated */
55           4 alloc_end_count fixed bin,                      /* number times allocated from end of segment */
56           4 alloc_new_count fixed bin,                      /* number times had to switch to a new segment */
57           4 alloc_time fixed bin(71),                       /* total time spent allocating */
58           4 words_alloced fixed bin(24),                    /* total number of words in beads alloc'ed this size */
59 
60 
61       2 first_seg_map;                                      /* first seg_map is created at this address */
62 
63 
64 dcl 1 seg_map aligned based(seg_map_p),                     /* there is one of these for each segment in APL heap-space */
65       2 seg_ptr pointer unaligned,                          /* -> base of segment */
66       2 smallest_piece fixed bin(18),                       /* minimum permissible size for a free bead */
67       2 number_of_entries fixed bin,                        /* size of map */
68       2 last_entry_used fixed bin,                          /* size of non-zero portion of map, used to speed up allocate */
69       2 amount_of_seg_used fixed bin(18),                   /* number of words in segment covered by the map */
70       2 map (map_size refer (seg_map.number_of_entries)),   /* one entry per free bead, in binary tree form */
71         3 size bit (18) unaligned,                          /* 0 if not a free bead, else number of words in free bead */
72         3 rel_loc bit (18) unaligned;                       /* 0 if not a free bead, else position in segment of free bead */
73 
74 /* pointers to above data */
75 
76 dcl seg_map_p pointer;
77 
78 /* ------ END INCLUDE SEGMENT           apl_storage_system_data.incl.pl1 -------------------------- */