Skip to content
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

Don't erase elements if multiple subscriptions use them #425

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

kilativ-dotcom
Copy link
Member

Copy link

codecov bot commented Oct 16, 2024

Codecov Report

Attention: Patch coverage is 97.63948% with 11 lines in your changes missing coverage. Please review.

Project coverage is 95.76%. Comparing base (1424e78) to head (b375f96).
Report is 81 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #425      +/-   ##
==========================================
+ Coverage   95.70%   95.76%   +0.05%     
==========================================
  Files         237      237              
  Lines       26965    27315     +350     
  Branches     1863     1880      +17     
==========================================
+ Hits        25808    26157     +349     
- Misses       1157     1158       +1     

sc-memory/sc-core/src/sc-store/sc-event/sc_event_queue.c Outdated Show resolved Hide resolved
Comment on lines 253 to 261
sc_uint32 * count = (sc_uint32 *)sc_hash_table_get(
manager->emitted_erase_events, GUINT_TO_POINTER(SC_ADDR_LOCAL_TO_INT(connector_addr)));
if (count == null_ptr)
{
count = sc_mem_new(sc_uint32, 1);
*count = 0;
}
++(*count);
sc_hash_table_insert(manager->emitted_erase_events, GUINT_TO_POINTER(SC_ADDR_LOCAL_TO_INT(connector_addr)), count);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
sc_uint32 * count = (sc_uint32 *)sc_hash_table_get(
manager->emitted_erase_events, GUINT_TO_POINTER(SC_ADDR_LOCAL_TO_INT(connector_addr)));
if (count == null_ptr)
{
count = sc_mem_new(sc_uint32, 1);
*count = 0;
}
++(*count);
sc_hash_table_insert(manager->emitted_erase_events, GUINT_TO_POINTER(SC_ADDR_LOCAL_TO_INT(connector_addr)), count);
sc_uint32 count = (sc_uint32)(sc_uint64)sc_hash_table_get(
manager->emitted_erase_events, GUINT_TO_POINTER(SC_ADDR_LOCAL_TO_INT(connector_addr)));
++count;
sc_hash_table_insert(manager->emitted_erase_events, GUINT_TO_POINTER(SC_ADDR_LOCAL_TO_INT(connector_addr)), count);

sc-memory/sc-core/src/sc-store/sc_storage.c Show resolved Hide resolved
sc-memory/sc-core/src/sc-store/sc_storage.c Outdated Show resolved Hide resolved
sc-memory/sc-core/src/sc-store/sc-event/sc_event_queue.c Outdated Show resolved Hide resolved
@NikitaZotov NikitaZotov changed the title Don't erase elements if multiple subsciptions use them Don't erase elements if multiple subscriptions use them Nov 4, 2024
sc-memory/sc-core/src/sc-store/sc_storage.c Outdated Show resolved Hide resolved
sc-memory/sc-core/src/sc-store/sc_storage.c Show resolved Hide resolved

sc_result _sc_storage_element_erase_with_incoming_outgoing_connectors(
sc_memory_context const * ctx,
sc_addr connector_chain_begin_addr,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is chain here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chain is like sequence of connectors next connector of which cannot exist without previous(previous element is source/target of next connector)

sc-memory/sc-core/src/sc-store/sc_storage.c Outdated Show resolved Hide resolved
sc-memory/sc-core/src/sc-store/sc_storage.c Outdated Show resolved Hide resolved
@NikitaZotov NikitaZotov added this to the 0.10.0 milestone Nov 25, 2024
@NikitaZotov NikitaZotov added bug Something isn't working sc-memory Changes in sc-memory module labels Nov 25, 2024
Copy link
Member

@NikitaZotov NikitaZotov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests are failed

@NikitaZotov NikitaZotov modified the milestones: 0.10.0, 0.10.1 Jan 28, 2025
@NikitaZotov NikitaZotov added 0.10.1 and removed 0.10.0 labels Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.10.1 bug Something isn't working sc-memory Changes in sc-memory module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants