* Calculate the PRELOAD flag of a mapping. */
| 224 | * Calculate the PRELOAD flag of a mapping. |
| 225 | */ |
| 226 | static bool calculatePreload(const Mapping *mapping) |
| 227 | { |
| 228 | const size_t SIZE = mapping->size; |
| 229 | const intptr_t BASE = mapping->base; |
| 230 | const intptr_t END = BASE + SIZE; |
| 231 | auto iend = Allocator::end(); |
| 232 | for (auto i = mapping->i; i != iend; ++i) |
| 233 | { |
| 234 | const Alloc *a = *i; |
| 235 | if (a->lb >= END) |
| 236 | break; |
| 237 | if (a->T == nullptr) |
| 238 | continue; |
| 239 | if (a->T->preload) |
| 240 | return true; |
| 241 | } |
| 242 | return false; |
| 243 | } |
| 244 | |
| 245 | /* |
| 246 | * Allocate a new mapping. |