MCPcopy Create free account
hub / github.com/GJDuck/e9patch / calculatePreload

Function calculatePreload

src/e9patch/e9mapping.cpp:226–243  ·  view source on GitHub ↗

* Calculate the PRELOAD flag of a mapping. */

Source from the content-addressed store, hash-verified

224 * Calculate the PRELOAD flag of a mapping.
225 */
226static 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.

Callers 1

saveMappingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected