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

Include free list size in URing memsize #120

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions ext/io/event/selector/list.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,19 @@ inline static void IO_Event_List_free(struct IO_Event_List *node)
}
}

inline static size_t IO_Event_List_memory_size(struct IO_Event_List *list)
{
size_t memsize = 0;

struct IO_Event_List *node = list->tail;
while (node != list) {
memsize += sizeof(struct IO_Event_List);
node = node->tail;
}

return memsize;
}

inline static int IO_Event_List_empty(struct IO_Event_List *list)
{
return list->head == list->tail;
Expand Down
1 change: 1 addition & 0 deletions ext/io/event/selector/uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ size_t IO_Event_Selector_URing_Type_size(const void *_selector)

return sizeof(struct IO_Event_Selector_URing)
+ IO_Event_Array_memory_size(&selector->completions)
+ IO_Event_List_memory_size(&selector->free_list)
;
}

Expand Down
Loading