mohan-chinnappan-n / leveldb

Automatically exported from code.google.com/p/leveldb
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Fix the kTargetFilesize will cause over int range problem #210

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. set the kTargetFilesize to 400 * 1048576
2. Then run the program
3.

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?

Please provide any additional information below.
static const int64_t kMaxGrandParentOverlapBytes = 10 * kTargetFileSize;
because 10 and kTargetFileSize is int type, so The result will beyond int. So 
the result will be minus
Then the kMaxGrandParentOverlapBytes will be minus

so I change the code by
static const int64_t kMaxGrandParentOverlapBytes = 10 * (int64_t) 
kTargetFileSize;
How can I submit the change?

Original issue reported on code.google.com by baot...@gmail.com on 21 Oct 2013 at 3:47

GoogleCodeExporter commented 9 years ago
kTargetFileSize is an internal implementation detail. If somebody is going to 
muck with internals, they need to be careful about such things.  It should be 
easy enough for you to apply the hand-edit to the definition of 
kMaxGrandParentOverlapBytes when you edit kTargetFileSize.

Original comment by san...@google.com on 21 Oct 2013 at 4:55