Provide definition and use SIZE_MAX for BFCAllocator::kInvalidChunkHandle

PiperOrigin-RevId: 324267861
Change-Id: I070baabf95939c60636d365d16ccc826175a76f5
This commit is contained in:
Lei Zhang 2020-07-31 12:58:40 -07:00 committed by TensorFlower Gardener
parent a5795009f8
commit 8eccff2ea1
2 changed files with 3 additions and 1 deletions
tensorflow/core/common_runtime

View File

@ -36,6 +36,8 @@ limitations under the License.
namespace tensorflow {
constexpr BFCAllocator::ChunkHandle BFCAllocator::kInvalidChunkHandle;
BFCAllocator::BFCAllocator(SubAllocator* sub_allocator, size_t total_memory,
bool allow_growth, const string& name,
bool garbage_collection)

View File

@ -133,7 +133,7 @@ class BFCAllocator : public Allocator {
// A ChunkHandle is an index into the chunks_ vector in BFCAllocator
// kInvalidChunkHandle means an invalid chunk
typedef size_t ChunkHandle;
static constexpr ChunkHandle kInvalidChunkHandle = -1;
static constexpr ChunkHandle kInvalidChunkHandle = SIZE_MAX;
typedef int BinNum;
static constexpr int kInvalidBinNum = -1;