layers: Distinguish never-bound from un-bound memory cases
authorTobin Ehlis <tobine@google.com>
Thu, 22 Sep 2016 16:52:00 +0000 (10:52 -0600)
committerTobin Ehlis <tobine@google.com>
Thu, 22 Sep 2016 23:12:57 +0000 (17:12 -0600)
commit50088a306f7947836b3558ea53dc132f6bd773b6
treef8a28ae06170d39e83f8f6548aac64f66139a147
parent66a56c33008dee5b39d5eb5a45349f8fee7a74e9
layers: Distinguish never-bound from un-bound memory cases

Fixes #964

Added special MEMORY_UNBOUND handle (0xF..FE) that indicates that memory
bound to an object has been freed. When attempting to bind memory or
checking for bound memory, distinguish the never-bound case from the
memory un-bound case.

For sparse binding case allow for memory to be re-bound.

Update tests to account for new error messages.

There's a sliver of exposure here if an actual memory handle is MEMORY_UNBOUND.
We could remove that exposure by never having unique_objects return MEMORY_UNBOUND
as a handle. I believe the exposure is small enough that we don't need to do that,
but am open to other opinions.
layers/core_validation.cpp