-
Notifications
You must be signed in to change notification settings - Fork 162
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
Reduce number of functions and macros which return pointers into GAP objects #2344
Conversation
This acts like %I, but takes a GAP string instead of a C string
... instead of pointers into those GAP strings, which could move during a garbage collection
This prevents yet another set of potentially GC bugs
Codecov Report
@@ Coverage Diff @@
## master #2344 +/- ##
==========================================
+ Coverage 73.07% 73.07% +<.01%
==========================================
Files 480 480
Lines 246622 246620 -2
==========================================
- Hits 180213 180212 -1
+ Misses 66409 66408 -1
|
Thanks, this is better than my changes were. I'll trust you checked all the packages for possible breakage! (Although tests will show us fairly soon after merging). After this is merged and settled, I will do another full pass of memory checking, just to make sure nothing was missed. |
Yes, I checked for conflicts with packages rather extensively: in my worktree, I have both a "bootstrap" pkg dir (i.e. with all the currently distributed packages, resp. their latest versions ready for distribution), and also another pkg dir with clones of all packages in |
More specifically, avoid returning
CSTR_STRING(foo)
for GAP stringsfoo
, as this is very prone to introduce bugs triggered by a garbage collection in the wrong moment.Some thoughts:
%H
added toPr()
actually replaced all instances of%I
, so we could drop the old%I
and rename%H
to%I
, thus reducing the final diff in this PR quite a bit.Closes #2337