Closed Bug 463260 Opened 16 years ago Closed 12 years ago

Want smart pointer template for new features

Categories

(Core :: JavaScript Engine, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: dmandelin, Unassigned)

References

Details

Since we're using C++ for new features in SpiderMonkey, it would be really nice to have a smart pointer template to simplify local resource management. Can we use auto_ptr? Or is there some other existing thing we can use?
By all means try to use standard C++. Let the porting porblem children emulate or acquire std impls of auto_ptr if lacking.

/be
We should look at the code gcc generates for auto_ptr. I ave very limited faith in gcc's code quality for complex C++ code.
Definitely should look at machine code -- we do for our own templatized smartptr helpers (nsCOMPtr, etc.) and they work on GCC.

/be
TR1 also contains a nice family of 'em (shared_ptr and weak_ptr, in addition to old auto_ptr), and are msvc / gcc supported.
TR1 seems to have a lot of nice stuff. Can we really start using it?
Severity: normal → enhancement
A family of home-grown SM smartpointers have sprung up in meantime.  shared_ptr/weak_ptr throw on alloc failure and, even if they didn't, we probably don't need to be using non-intrusive thread-safe smartpointers in SM anyhow.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.