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

Make profiling correctly handle the same file being opened multiple times #1069

Merged
merged 1 commit into from
Jan 13, 2017

Conversation

ChrisJefferson
Copy link
Contributor

This patch makes profiling correctly handle the same file being opened multiple times, by associating it with the same integer filename.

This is unfortunately hard to automatically test -- but I've tested it manually for a few tests and it works fine (the profiling should have a better automated testsuite...).

This doesn't require a change in profiling, and should work with any version.

@codecov-io
Copy link

codecov-io commented Jan 12, 2017

Current coverage is 54.12% (diff: 100%)

Merging #1069 into master will increase coverage by 0.01%

@@             master      #1069   diff @@
==========================================
  Files           429        429          
  Lines        226660     226662     +2   
  Methods        3435       3436     +1   
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits         122661     122687    +26   
+ Misses       103999     103975    -24   
  Partials          0          0          
Diff Coverage File Path
•••••••••• 100% src/code.c

Powered by Codecov. Last update 9fffac5...bc95e8b

@ChrisJefferson
Copy link
Contributor Author

Sorry, made a change after sleeping on the patch -- realised that I was storing a GAP string in a C structure which might get garbage collected! Now using copy of string in a structure which I know won't get GCed.

@fingolfin
Copy link
Member

Ahh, that's quite subtle -- good thinking :)

@fingolfin
Copy link
Member

Can you perhaps edit the commit message and elaborate; e.g. copy the description of this PR, perhaps add the note in your last commen?

This patch ensures when reopening a file we check if the filename
has been opened previously, and if so associate it with the same
filename number.

This is tested in the 'profiling' package, which is why there is no
tests here.
@ChrisJefferson
Copy link
Contributor Author

Better commit message. Also since writing this I've put tests into the profiling package to check reading a file multiple times works.

@fingolfin fingolfin merged commit 06d8435 into gap-system:master Jan 13, 2017
@ChrisJefferson ChrisJefferson deleted the profile-multifile branch February 5, 2017 10:36
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