13b5c48512c446758c193eefa63e8acac815d7b7
Bug: b/121214641 Merge of http://go/wvgerrit/69703 Test: Android + Linux unit tests LoadEntry attempts to handle INSUFFICIENT_RESOURCES by deleting an entry and retrying, but it's possible that the randomly-generated number of the entry to be deleted might match the entry we want to load. In this case, we have wasted a retry, since the code just continues on to the next iteration. This is changed to generate a number different from the entry to load. Furthermore, if the number of usage entries is 1, we break since there are no more entries to delete besides the one we want to load. The code is also changed to call srand in the creation of the usage_table_header, since without it, rand() would produce the same values, and similarly, our random generation is changed to use a simple mod. Tests are modified to reflect these changes. Change-Id: I95e125b8adbd85d0189f9d40ca15f3fe69e6d6b9
Description
No description provided