Closed
Bug 618049
Opened 15 years ago
Closed 7 years ago
xpc_qsACString copies its string twice, should only do it once
Categories
(Core :: XPConnect, defect)
Core
XPConnect
Tracking
()
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
blocking2.0 | --- | - |
People
(Reporter: bent.mozilla, Assigned: bent.mozilla)
References
Details
xpc_qsACString calls JS_EncodeString, which manages a JS engine malloc'd buffer. Then we copy that buffer to nsCString before freeing the JS engine's buffer. We could just call JS_EncodeStringToBuffer and only do it once.
![]() |
||
Comment 1•15 years ago
|
||
Not quite, because that would be allocated with whatever allocator js uses, while strings will free with the nsMemory allocator, which may not be the same. :(
Assignee | ||
Comment 2•15 years ago
|
||
No, you just preallocate the nsCString buffer (via SetCapacity) then JS_EncodeStringToBuffer writes to that.
Assignee | ||
Comment 3•15 years ago
|
||
(i.e. don't Adopt())
![]() |
||
Comment 4•15 years ago
|
||
Oh, I see. Yeah, that sounds good.
Comment 5•15 years ago
|
||
Not blocking on this. I'd approve a safe patch, but won't hold the release for this.
blocking2.0: betaN+ → -
Comment 7•14 years ago
|
||
I assume this is still valid.
Comment 8•7 years ago
|
||
Per policy at https://wiki.mozilla.org/Bug_Triage/Projects/Bug_Handling/Bug_Husbandry#Inactive_Bugs. If this bug is not an enhancement request or a bug not present in a supported release of Firefox, then it may be reopened.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → INACTIVE
![]() |
||
Comment 9•7 years ago
|
||
Quickstubs are gone, and webidl bindings don't have this problem.
Depends on: 1019191
Resolution: INACTIVE → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•