-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Vec allocation #[track_caller] should be removed #146963
Copy link
Copy link
Closed
Labels
C-bugCategory: This is a bug.Category: This is a bug.I-heavyIssue: Problems and improvements with respect to binary size of generated code.Issue: Problems and improvements with respect to binary size of generated code.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.I-heavyIssue: Problems and improvements with respect to binary size of generated code.Issue: Problems and improvements with respect to binary size of generated code.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
#126557 added
#[track_caller]to lots of allocating methods on Vec.The description of all 3 PRs are very light on details, and what they don't reveal (and their added tests can't reveal since there are none):
-Zoom=panic, it doesn't work today, locations always point at the alloc crate.I am a bit puzzled about 1). Was this never tested when the PR was opened or am I missing something? For 2) I didn't verify whether it worked originally, but even if it did, it then broke later. No one bothered to report its breakage, which I take as evidence that this feature is not very useful (probably due to 1)).
I don't think this feature is that useful because while it can be neat to see the location immediately, it's not that useful since backtraces do the same thing with only slightly more effort. If it was free I wouldn't mind, but it is not:
The feature had a 1-2% binary size impact, which is pretty significant (which was pointed out by @nnethercote on the PR). It meant that every inclined
.push()had to get a location before calling the grow function, which is several instructions.Test code:
Example output (default):
memory allocation of 400000000000000 bytes failedExample output (from push, -Zoom=panic):