-
Notifications
You must be signed in to change notification settings - Fork 27
Implementation of sc-memory based on disk space #495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Implementation of sc-memory based on disk space #495
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Caution
Changes requested ❌
Reviewed everything up to fc6f7f5 in 3 minutes and 18 seconds. Click for details.
- Reviewed
4739lines of code in12files - Skipped
0files when reviewing. - Skipped posting
4draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. sc-memory/sc-core/src/sc-store/sc-fs-memory/sc_file_system.c:92
- Draft comment:
BUG: The allocated 'command' buffer is not initialized before using strcat. This may lead to undefined behavior. Use strcpy or zero‐initialize the buffer. - Reason this comment was not posted:
Comment was on unchanged code.
2. sc-memory/sc-core/src/sc-store/sc-fs-memory/sc_file_system.c:205
- Draft comment:
BUG: 'char_result' is used without allocation. sc_str_cpy is called on an uninitialized pointer. - Reason this comment was not posted:
Comment was on unchanged code.
3. sc-memory/sc-core/src/sc-store/sc_segment.h:35
- Draft comment:
Typo in the parameter comment: "Number of created instance in sc-memory" should be "Number of created instances in sc-memory". - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
4. sc-memory/sc-core/src/sc-store/sc_storage.c:660
- Draft comment:
Typographical note: The identifier 'null_ptr' in this new line may be a typo. If the intention is to use a null pointer literal, consider using 'nullptr' (in C++) or 'NULL' (in C) depending on your code's conventions. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
Workflow ID: wflow_Q1jJLymj506I50iT
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
| if (!cache->tail) | ||
| cache->tail = node; | ||
| cache->size++; | ||
| sc_hash_table_insert(cache->segments, &seg_num, node); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BUG: In _sc_l1_cache_add, using &seg_num as key for hash table insertion is unsafe. Use a stable key (e.g. GINT_TO_POINTER) instead.
| sc_hash_table_insert(cache->segments, &seg_num, node); | |
| sc_hash_table_insert(cache->segments, GUINT_TO_POINTER(seg_num), node); |
| io_destroy(ctx); | ||
| close(fd); | ||
|
|
||
| sc_hash_table_insert(cache->segments, &seg_num, (void *)(intptr_t)entry.offset); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BUG: In _sc_l2_cache_add, the key is inserted using &seg_num, a pointer to a local variable. Use a stable representation (e.g. GINT_TO_POINTER(seg_num)).
Important
Implements disk-based sc-memory with L1/L2 caching, asynchronous I/O, and buffered operations for enhanced efficiency and scalability.
sc_storage.cfor efficient memory management using DRAM and SSD/NVMe._sc_l1_cache_init(),_sc_l1_cache_destroy(),_sc_l1_cache_add(),_sc_l1_cache_get(),_sc_l2_cache_init(),_sc_l2_cache_destroy(),_sc_l2_cache_add(),_sc_l2_cache_get()for cache operations.sc_segment_bufferfor buffering operations insc_storage.c.write_segment_async()andwrite_segments_parallel()insc_fs_memory.cfor asynchronous and parallel segment writing.libaioandpthreadfor I/O operations._sc_storage_add_operation()and_sc_storage_flush_buffer()insc_storage.cto handle buffered operations.SC_OP_NODE_NEW,SC_OP_ARC_NEW,SC_OP_LINK_NEW,SC_OP_SET_LINK_CONTENT,SC_OP_ERASE_ELEMENT.sc_fs_memory.cto handle file-based storage, including reading and writing segments to disk.sc_file_system.candsc_io.hfor file operations.sc_storage_initialize()andsc_storage_shutdown()insc_storage.cto integrate new memory management features.sc_storage_private.hfor internal storage management.This description was created by
for fc6f7f5. You can customize this summary. It will automatically update as commits are pushed.