On Tue, Jan 12, 2010 at 7:13 PM, Evan Martin <[email protected]> wrote:
> In this bug
> http://code.google.com/p/chromium/issues/detail?id=28749
> It seems we're running afoul of a more finicky compiler not liking
> some tricks we're playing with objects and memory in LazyInstance.
> (You can skip down to comment #30 or so to get to the meat of it --
> above that point we were still trying to figure out what was causing
> the crash.)
>
> I know enough to say that it sounds like the solution to the problem
> should involve placement new, but that is the extent of my C++ skill.
> If you are a wizard, could you take a look at the patch Craig posted
> on the bug (http://codereview.chromium.org/519045/show) and comment
> there?
[see base/lazy_instance.{h,c}]
One possible way of attacking the problem is to ignore the stuff I
posted and just figure out how to plumb the return value from the
placement new in New() through to Pointer() and use that return value
instead of instance in Pointer() but to do it without bloating up the
header file with lots more code. It's the reinterpret_cast in
Pointer() that we want to avoid.
I actually have a patch that does the ugly thing I suggested in the
last comment in rietveld but my brain is coming unstuck trying to work
out how to do Darin's suggestion which is likely to be more elegant
than my attempts.
Any help is welcome :)
--Craig
--
Chromium Developers mailing list: [email protected]
View archives, change email options, or unsubscribe:
http://groups.google.com/group/chromium-dev