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)
commit888cae09036ec622d6014e18efbda55e6226cf22
treeec90a03d49cca7c4c086e8e9351eb8ac2f8c3128
parent6b7e78663bec13ba8e66568a47a111f6adf592cd
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
tests/layer_validation_tests.cpp