Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Greptile SummaryThis PR replaces the old The implementation resolves several prior issues:
Critical remaining issues:
Confidence Score: 2/5
Important Files Changed
|
This comment was marked as resolved.
This comment was marked as resolved.
Co-authored-by: yinzefeng.yzf <yinzefeng.yzf@alibaba-inc.com>
Changed 'your-org' placeholder to 'alibaba' in the git clone command to reflect the correct repository URL.
…BUTING (#150) - README.md: remove spurious space in align=" center" → align="center" (logo was not centered on GitHub due to invalid HTML attribute value) - CONTRIBUTING.md: correct Python prerequisite from '>= 3.9' to '3.10 - 3.12' to match pyproject.toml classifiers and CI matrix (cp310, cp312)
|
@greptile |
|
@greptile |
|
@greptile |
|
@greptile |
|
@greptile |
|
@greptile |
|
@greptile |
|
@greptile |
| void acquire_one(block_id_t block_id); | ||
|
|
||
| private: | ||
| VecBufferPool &pool; |
There was a problem hiding this comment.
use pool_ as member variable
| class VecBufferPoolHandle { | ||
| public: | ||
| VecBufferPoolHandle(VecBufferPool &pool) : pool(pool) {} | ||
| VecBufferPoolHandle(VecBufferPoolHandle &&other) : pool(other.pool) {} |
There was a problem hiding this comment.
use std::move to avoid copy
| IndexFormat::MetaHeader header_{}; | ||
| IndexFormat::MetaFooter footer_{}; | ||
| std::map<std::string, IndexMapping::SegmentInfo> segments_{}; | ||
| std::map<std::string, size_t> id_hash_{}; |
There was a problem hiding this comment.
try unordered hashmap?
| get_buffer_handle(offset, sizeof(footer_)); | ||
| void *buffer = footer_handle.pin_vector_data(); | ||
| int ParseFooter(size_t offset) { | ||
| char *buffer = new char[sizeof(footer_)]; |
There was a problem hiding this comment.
std::unique_ptr<char[]> buffer(new char[sizeof(footer_)]);
| get_buffer_handle(offset, sizeof(header_)); | ||
| void *buffer = header_handle.pin_vector_data(); | ||
| int ParseHeader(size_t offset) { | ||
| char *buffer = new char[sizeof(header_)]; |
There was a problem hiding this comment.
std::unique_ptr<char[]> buffer(new char[sizeof(footer_)]);
| char *LPMap::set_block_acquired(block_id_t block_id, char *buffer) { | ||
| assert(block_id < entry_num_); | ||
| Entry &entry = entries_[block_id]; | ||
| if (entry.ref_count.load(std::memory_order_relaxed) >= 0) { |
There was a problem hiding this comment.
judge the return value of fetch_add?
resolve #64