Skip to content

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

Merged
iphydf merged 1 commit intoTokTok:masterfrom
iphydf:memdup
Jan 13, 2024
Merged

refactor: Factor out malloc+memcpy into memdup.#2538
iphydf merged 1 commit intoTokTok:masterfrom
iphydf:memdup

Conversation

@iphydf
Copy link
Copy Markdown
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
@codecov
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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.

@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
@iphydf iphydf deleted the memdup branch January 13, 2024 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants