Take file size using fstat in map_in_file() in umap_file.hpp
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 7
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
In map_in_file(), I think, we can take the file size using fstat instead of using the 'numbytes' argument when either initonly or !noinit is true.
Consequently, the code below won't be necessary.
if ( (off_t)sbuf.st_size != (numbytes) ) {
std::cerr << filename << " size " << sbuf.st_size
<< " does not match specified data size of " << (numbytes) << std::endl;
return NULL;
}
What do you think?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/utility/umap_file.hpp at map_in_file() and inspect how initonly, noinit, numbytes, and the existing fstat result are used. Determine whether fstat should provide the file size in the stated cases, then verify that the redundant size-mismatch check is no longer needed and that the existing behavior remains valid.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- operating-systems
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100