[Webkit-unassigned] [Bug 102828] r134080 causes heap problem on linux systems where PAGESIZE != 4096
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Jan 18 10:37:45 PST 2013
https://bugs.webkit.org/show_bug.cgi?id=102828
--- Comment #33 from Balazs Kilvady <kilvadyb at homejinni.com> 2013-01-18 10:39:32 PST ---
(In reply to comment #32)
> (From update of attachment 183468 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=183468&action=review
>
> Additionally, there's a function named "sizeFromCapacity" in MarkStackSegment. That doesn't appear to be called from anywhere, so let's remove it while we're here.
>
> > Source/JavaScriptCore/heap/MarkStack.cpp:47
> > +#if COMPILER(CLANG)
>
> Let's not ignore the warnings.
>
> > Source/JavaScriptCore/heap/MarkStack.cpp:52
> > +const size_t MarkStackArray::s_segmentCapacity = MarkStackSegment::capacityFromSize(MarkStackSegment::blockSize);
>
> If we could use C++11, we could just add constexpr to capacityFromSize and call it a day. Unfortunately we can't, so we have to use some template magic.
>
> Instead of using the old capacityFromSize static function, let's rework the code a little bit. From some brief grepping, it appears that this is the only client of the capacityFromSize function. So in order to get a compile-time constant value, we can instead use a template. Something along the lines of:
>
> template <size_t size> struct CapacityFromSize {
> static const size_t value = // body of current capacityFromSize
> };
>
> Stick that somewhere private in MarkStackArray and grab the ::value when defining s_segmentCapacity.
Thank you for reviewing. I also see a windows specific problem. A static member should be used only in it's dll |(otherwise there are memory address problems in dllexport - JavaScriptCore and dllimport - WebCore modules) so the inline functions which are using it should be moved to the .cpp file. Is the template trick solves this problem also or should I return to the non-static member solution?
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list