Changeset c2794b2 for libcfa/src/containers
- Timestamp:
- May 17, 2021, 9:32:35 PM (3 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- d286e94d
- Parents:
- 02a43ff
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/containers/list.hfa
r02a43ff rc2794b2 125 125 verify(linkToInsert.prev == 0p); 126 126 verify(linkToInsert.next == 0p); 127 tE & list_pos_raw = list_pos; 128 tE & list_pos_elem = * (tE *) ORIGIN_TAG_CLEAR( (size_t) & list_pos_raw ); 127 tE & list_pos_elem = * (tE *) ORIGIN_TAG_CLEAR( (size_t) & list_pos ); 129 128 dlink(tE) & list_pos_links = list_pos_elem`inner; 130 129 asm( "" : : : "memory" ); 131 130 tE & after_raw = * list_pos_links.next; 132 131 tE & after_elem = * (tE *) ORIGIN_TAG_CLEAR( (size_t) & after_raw ); 133 linkToInsert.prev = & list_pos _raw;132 linkToInsert.prev = & list_pos; 134 133 linkToInsert.next = & after_raw; 135 134 dlink(tE) & afterLinks = after_elem`inner; … … 145 144 verify(linkToInsert.next == 0p); 146 145 verify(linkToInsert.prev == 0p); 147 tE & list_pos_raw = list_pos; 148 tE & list_pos_elem = * (tE *) ORIGIN_TAG_CLEAR( (size_t) & list_pos_raw ); 146 tE & list_pos_elem = * (tE *) ORIGIN_TAG_CLEAR( (size_t) & list_pos ); 149 147 dlink(tE) & list_pos_links = list_pos_elem`inner; 150 148 asm( "" : : : "memory" ); 151 149 tE & before_raw = * (list_pos_links).prev; 152 150 tE & before_elem = * (tE *) ORIGIN_TAG_CLEAR( (size_t) & before_raw ); 153 linkToInsert.next = & list_pos _raw;151 linkToInsert.next = & list_pos; 154 152 linkToInsert.prev = & before_raw; 155 153 dlink(tE) & beforeLinks = before_elem`inner; … … 161 159 static inline tE & remove(tE & list_pos) { 162 160 verify (&list_pos != 0p); 163 tE & list_pos_elem = list_pos; 164 verify( ! ORIGIN_TAG_QUERY((size_t) & list_pos_elem) ); 165 dlink(tE) & list_pos_links = list_pos_elem`inner; 161 verify( ! ORIGIN_TAG_QUERY((size_t) & list_pos) ); 162 dlink(tE) & list_pos_links = list_pos`inner; 166 163 tE & before_raw = * list_pos_links.prev; 167 164 tE & before_elem = * (tE *) ORIGIN_TAG_CLEAR( (size_t) & before_raw ); … … 176 173 list_pos_links.next = 0p; 177 174 asm( "" : : : "memory" ); 178 return list_pos _elem;175 return list_pos; 179 176 } 180 177 … … 194 191 if (ORIGIN_TAG_QUERY((size_t)firstPtr)) firstPtr = 0p; 195 192 return firstPtr == 0p; 193 } 194 195 static inline bool ?`isListed( tE & e ) { 196 verify (&e != 0p); 197 dlink(tE) & e_links = e`inner; 198 return (e_links.prev != 0p) || (e_links.next != 0p); 196 199 } 197 200
Note: See TracChangeset
for help on using the changeset viewer.