Skip to content
Commit f3df7e86 authored by Sean Callanan's avatar Sean Callanan
Browse files

Updated the FindSpace() algorithm to avoid the 0 page when it's unsafe.

Previously we eliminated the randomized scheme for finding memory when the
underlying process cannot allocate memory, and replaced it with an algorithm
that starts the allocations at 00x.

This was more determinstic, but runs into problems on embedded targets where the
pages near 0x0 are in fact interesting memory.  To deal with those cases, this
patch does two things:

- It makes the default fallback be an address that is less likely than 0x0 to
  contain interesting information.

- Before falling back to this, it adds an algorithm that consults the
  GetMemoryRegionInfo() API to see if it can find an unmapped area.

This should eliminate the randomness (and unpredictable memory accesseas) of the
previous scheme while making expressions more likely to return correct results.

<rdar://problem/25545573>

llvm-svn: 272301
parent 0ab9d302
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment