[Webkit-unassigned] [Bug 20422] New: Patch to allow custom memory allocation control.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Aug 18 01:26:54 PDT 2008


https://bugs.webkit.org/show_bug.cgi?id=20422

           Summary: Patch to allow custom memory allocation control.
           Product: WebKit
           Version: 526+ (Nightly build)
          Platform: All
        OS/Version: All
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: ppedriana at gmail.com


This submission consists of two files: New.h and OperatorNewTest.cpp. The
former implements a base header file which allows for custom control of memory
allocation in WebKit. The latter implements a basic unit test for New.h. 

The usefulness of this feature was discussed in June on the webkit-dev mailing
list. See the following for context:
https://lists.webkit.org/pipermail/webkit-dev/2008-June/004089.html. In
summary, this system allows for the external redirection of memory allocation
in WebKit to a user-specified heap or heaps. It provides for this by two means:
overriding operator new in C++ classes (usually via a base class), and by
overriding global operator new. Users have responded that the first means is
preferred, though there may be cases where classes aren't used or where malloc
is being used instead of new and thus the second means would be needed. These
means are mutually compatible. 

Initially this submission does not include a WebKit-wide patch to convert code
to using this system, nor does it need to at this time. In theory, WebKit code
can be migrated to take advantage of this in a gradual manner, though the
intended ability for the user to control memory allocation WebKit-wide won't be
possibly until the migration is complete. This initial submission is a more
formal RFC than that proposed on the mailing list and after discussion
modifications and a full WebKit-wide patch to use it can be considered. New.h
could be checked into the codebase and undergo initial testing before any patch
to use it WebKit-wide was constructed and submitted. 

This submission is motivated by the necessity to tightly control memory on
embedded platforms, especially where WebKit is not the primary application but
instead is a library used within another application. Additionally, the
submission significantly benefits the KDE project by allowing memory
optimizations that they otherwise are unable to implement. I will defer to a
representative from KDE to step in and clarify this further. 

This submission should not affect the optimized WebKit runtime in any
significant way. It is unlikely to affect the WebKit build speed or memory
usage either. The primary downside to the proposed system is that it will
require a number of modifications to the WebKit code (adding base class
operators) to take advantage of.


-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list