Don't use std::shared_ptr in CStrIntern #6965
No reviewers
Labels
No Label
Closed
Duplicate
Closed
Fixed
Closed
Invalid
Closed
Needs info
Closed
Won't fix
Closed
Works for me
Difficulty
Hard
Difficulty
Medium
Difficulty
Simple
Needed for Beta
Needs Design Input
Needs Info
Pathfinding
Priority
1: Release Blocker
Priority
2: Must Have
Priority
3: Should Have
Priority
4: Nice To Have
Priority
5: If Time Permits
Regression
Theme
AI
Theme
Art & Animation
Theme
Atlas editor
Theme
Build & Packages
Theme
Core engine
Theme
Internationalization & Localization
Theme
Maps
Theme
Multiplayer Lobby
Theme
Music & Sound FX
Theme
Network
Theme
Non-game systems
Theme
Simulation
Theme
UI & Simulation
Theme
UI – Game setup
Theme
UI – In-game
Theme
UI – Miscellaneous
Theme
Website & Forum
Type
Defect
Type
Enhancement
Type
Task
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: 0ad/0ad#6965
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "phosit/0ad:Don't_use_shared_ptr_in_CStdIntern"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Now there is less allocation and reference counting.
Continuation of https://code.wildfiregames.com/D5155
A commit message "Imported from Phab" is no good :)
Why?
Should it be "Don't use std::shared_ptr in CStrIntern" again?
Normaly a branch starts as "Initial commit". That isn't much better.
The branch name and the title and message of the pull request are irrelevant for how the commit will look like once merge.
You can fix the commit message with "git commit --amend", then check how it looks like with "git log".
With the rebase workflow "Imported from Phab" will be committed to main. There is no squash. Nor commit renaming. You have to do that on the branch.
Thanks for the explanation
8d48b161ee
to89750f84e6
@ -108,3 +111,1 @@
std::shared_ptr<CStrInternInternals> internals = std::make_shared<CStrInternInternals>(str, len);
g_Strings.insert(std::make_pair(internals->data, internals));
return internals.get();
return &g_Strings.insert({str, {str, len}}).first->second;
maybe make the return type a reference to signal doesn't need delete and is never null?
I've done that in https://code.wildfiregames.com/D5157
This patch here returns a pointer tho
I see, someone wasn't a big fan of it :)
89750f84e6
to318c0aecd2
318c0aecd2
to45d51b7cf6