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

main: Don't strdup the inputFileName when storing a tag to the corkQueue #3682

Conversation

masatake
Copy link
Member

When storing a tag entry to the corkQueue, the most of members of the tag entry are duplicated for isolating the the stored tag entry from the original parsing context.

In the most of all cases, we can expect all tag entries in the corkQueue has the same value as inputFileName member. Strdup'ing the value is waste of memory resource especially when the input file name is long.

@codecov
Copy link

codecov bot commented Mar 28, 2023

Codecov Report

Patch coverage: 84.61% and project coverage change: -0.01 ⚠️

Comparison is base (8a4f1ae) 82.88% compared to head (9fd7417) 82.88%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3682      +/-   ##
==========================================
- Coverage   82.88%   82.88%   -0.01%     
==========================================
  Files         224      224              
  Lines       54684    54689       +5     
==========================================
+ Hits        45327    45330       +3     
- Misses       9357     9359       +2     
Impacted Files Coverage Δ
main/dependency.c 95.50% <66.66%> (-1.01%) ⬇️
main/entry.c 86.74% <100.00%> (-0.05%) ⬇️
main/parse.c 95.61% <100.00%> (+<0.01%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

When storing a tag entry to the corkQueue, the most of members
of the tag entry are duplicated for isolating the the stored tag
entry from the original parsing context.

In the most of all cases, we can expect all tag entries in the
corkQueue has the same value as inputFileName member. Strdup'ing
the value is waste of memory resource especially when the input
file name is long.

Signed-off-by: Masatake YAMATO <[email protected]>
@masatake masatake force-pushed the main--reuse-input-file-name-in-corkqueue branch from d18bbb3 to 9fd7417 Compare March 28, 2023 15:34
@masatake masatake merged commit c2cb0d1 into universal-ctags:master Mar 31, 2023
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.

1 participant