Closed
Bug 733758
Opened 13 years ago
Closed 13 years ago
Inspecting the value of a CDataFinalizer without calling forget
Categories
(Core :: js-ctypes, enhancement)
Core
js-ctypes
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: Yoric, Assigned: Yoric)
References
Details
Attachments
(2 files)
(deleted),
patch
|
jorendorff
:
feedback+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
Details | Diff | Splinter Review |
At the moment, CDataFinalizer will not let code inspect the value held without calling |forget|. I have come across at least one case blocked by this: extracting the value from the finalizer to send it to a worker thread.
Just as Scoped pointers have a method |get|, we should have a method |value| to extract the value without calling |forget|.
Assignee | ||
Comment 1•13 years ago
|
||
Assignee | ||
Comment 2•13 years ago
|
||
Assignee | ||
Updated•13 years ago
|
Attachment #603717 -
Flags: feedback?(jorendorff)
Comment 3•13 years ago
|
||
Comment on attachment 603717 [details] [diff] [review]
Implementation of attribute |value|
Looks like the right idea.
In the test, I think this line is wrong because it assumes GC did not run:
>+ do_check_eq(count_finalized(size, tc), 0);
Attachment #603717 -
Flags: feedback?(jorendorff) → feedback+
Assignee | ||
Comment 4•13 years ago
|
||
Thanks for the feedback.
Taras has managed to convince me that I should try and implement OS.File without using this, so I am not going to push that patch much forward for the moment.
Assignee | ||
Comment 5•13 years ago
|
||
Turns out that we can simply cast a CDataFinalizer to its type using ctypes.cast, so this feature is useless.
Severity: normal → enhancement
Status: NEW → RESOLVED
Closed: 13 years ago
OS: Mac OS X → All
Hardware: x86 → All
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•