BUG: Lucene.Net.Core.Util.RamUsageEstimator: Added byte, ushort, uint, and ulong to the primitiveSizes table (byte in particular was causing the Lucene.Net.Util.Packed.TestPackedInts() test to fail).
Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/ae79c536 Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/ae79c536 Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/ae79c536 Branch: refs/heads/api-work Commit: ae79c536cfc9d855b46fca0ebe61c3c5c2862b42 Parents: f6f2ac0 Author: Shad Storhaug <[email protected]> Authored: Wed Mar 8 17:05:14 2017 +0700 Committer: Shad Storhaug <[email protected]> Committed: Wed Mar 8 17:05:14 2017 +0700 ---------------------------------------------------------------------- src/Lucene.Net.Core/Util/RamUsageEstimator.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ae79c536/src/Lucene.Net.Core/Util/RamUsageEstimator.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Core/Util/RamUsageEstimator.cs b/src/Lucene.Net.Core/Util/RamUsageEstimator.cs index be123f7..023d3f5 100644 --- a/src/Lucene.Net.Core/Util/RamUsageEstimator.cs +++ b/src/Lucene.Net.Core/Util/RamUsageEstimator.cs @@ -111,16 +111,19 @@ namespace Lucene.Net.Util static RamUsageEstimator() { - // LUCENENET TODO: Add sizes for the other primitive types primitiveSizes = new HashMap<Type, int>(8); primitiveSizes[typeof(bool)] = Convert.ToInt32(NUM_BYTES_BOOLEAN); primitiveSizes[typeof(sbyte)] = Convert.ToInt32(NUM_BYTES_BYTE); + primitiveSizes[typeof(byte)] = Convert.ToInt32(NUM_BYTES_BYTE); primitiveSizes[typeof(char)] = Convert.ToInt32(NUM_BYTES_CHAR); primitiveSizes[typeof(short)] = Convert.ToInt32(NUM_BYTES_INT16); + primitiveSizes[typeof(ushort)] = Convert.ToInt32(NUM_BYTES_INT16); primitiveSizes[typeof(int)] = Convert.ToInt32(NUM_BYTES_INT32); + primitiveSizes[typeof(uint)] = Convert.ToInt32(NUM_BYTES_INT32); primitiveSizes[typeof(float)] = Convert.ToInt32(NUM_BYTES_SINGLE); primitiveSizes[typeof(double)] = Convert.ToInt32(NUM_BYTES_DOUBLE); primitiveSizes[typeof(long)] = Convert.ToInt32(NUM_BYTES_INT64); + primitiveSizes[typeof(ulong)] = Convert.ToInt32(NUM_BYTES_INT64); // Initialize empirically measured defaults. We'll modify them to the current // JVM settings later on if possible.
