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

refactor: Factor out malloc+memcpy into memdup. #2538

Merged
merged 1 commit into from
Jan 13, 2024
Merged

Conversation

iphydf
Copy link
Member

@iphydf iphydf commented Jan 10, 2024

Only applied in one place, but perhaps later we can implement a pattern in tokstyle to find more opportunities for using memdup.


This change is Reviewable

@iphydf iphydf added this to the v0.2.19 milestone Jan 10, 2024
@iphydf iphydf marked this pull request as ready for review January 10, 2024 10:47
@iphydf iphydf force-pushed the memdup branch 2 times, most recently from a2341b9 to 457d69c Compare January 10, 2024 10:48
Copy link

codecov bot commented Jan 10, 2024

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (07fe665) 68.29% compared to head (c4e209e) 68.35%.
Report is 1 commits behind head on master.

Files Patch % Lines
toxcore/group_connection.c 33.33% 2 Missing ⚠️
toxcore/group_chats.c 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2538      +/-   ##
==========================================
+ Coverage   68.29%   68.35%   +0.06%     
==========================================
  Files         118      118              
  Lines       28162    28165       +3     
==========================================
+ Hits        19232    19252      +20     
+ Misses       8930     8913      -17     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Green-Sky
Copy link
Member

we are not using mem because?

@iphydf iphydf force-pushed the memdup branch 2 times, most recently from 9093887 to 374b8f1 Compare January 10, 2024 14:06
@iphydf
Copy link
Member Author

iphydf commented Jan 10, 2024

we are not using mem because?

mem isn't used in NGC very much yet. This is a follow-up PR for the other malloc-call PR and shouldn't change too much at once. I think it makes sense for mem.h to have a mem_dup function in it, later.

toxcore/util.c Outdated Show resolved Hide resolved
@iphydf iphydf force-pushed the memdup branch 3 times, most recently from 7ea981b to d60caad Compare January 13, 2024 11:56
Only applied in one place, but perhaps later we can implement a pattern
in tokstyle to find more opportunities for using memdup.
@iphydf iphydf merged commit c4e209e into TokTok:master Jan 13, 2024
54 checks passed
@iphydf iphydf deleted the memdup branch January 13, 2024 12:17
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants