Bug 52055

Summary: [WIN] Remove pthread dependency of FastMalloc
Product: WebKit Reporter: Patrick R. Gansterer <paroga>
Component: PlatformAssignee: Patrick R. Gansterer <paroga>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: ap, aroben, eric, levin, mrowe, webkit-ews, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on: 41790, 45186    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description Patrick R. Gansterer 2011-01-07 06:36:34 PST
see patch
Comment 1 Patrick R. Gansterer 2011-01-07 06:53:30 PST
Created attachment 78228 [details]
Patch
Comment 2 Early Warning System Bot 2011-01-07 12:50:01 PST
Attachment 78228 [details] did not build on qt:
Build output: http://queues.webkit.org/results/7404032
Comment 3 Patrick R. Gansterer 2011-01-07 13:01:17 PST
Created attachment 78258 [details]
Patch
Comment 4 WebKit Review Bot 2011-01-07 13:34:40 PST
Attachment 78228 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/ChangeLog', u'Source/JavaScriptCore/wtf/FastMalloc.cpp']" exit_code: 1
Source/JavaScriptCore/wtf/FastMalloc.cpp:428:  "pthread.h" already included at Source/JavaScriptCore/wtf/FastMalloc.cpp:83  [build/include] [4]
Source/JavaScriptCore/wtf/FastMalloc.cpp:1448:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Source/JavaScriptCore/wtf/FastMalloc.cpp:1500:  TCMalloc_PageHeap::runScavengerThread is incorrectly named. Don't use underscores in your identifier names.  [readability/naming] [4]
Source/JavaScriptCore/wtf/FastMalloc.cpp:1511:  TCMalloc_PageHeap::initializeScavenger is incorrectly named. Don't use underscores in your identifier names.  [readability/naming] [4]
Total errors found: 4 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 WebKit Review Bot 2011-01-07 13:47:05 PST
Attachment 78258 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/ChangeLog', u'Source/JavaScriptCore/wtf/FastMalloc.cpp']" exit_code: 1
Source/JavaScriptCore/wtf/FastMalloc.cpp:1446:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Source/JavaScriptCore/wtf/FastMalloc.cpp:1498:  TCMalloc_PageHeap::runScavengerThread is incorrectly named. Don't use underscores in your identifier names.  [readability/naming] [4]
Source/JavaScriptCore/wtf/FastMalloc.cpp:1509:  TCMalloc_PageHeap::initializeScavenger is incorrectly named. Don't use underscores in your identifier names.  [readability/naming] [4]
Total errors found: 3 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 6 Patrick R. Gansterer 2011-01-10 12:50:49 PST
Created attachment 78433 [details]
Patch
Comment 7 WebKit Review Bot 2011-01-10 12:53:07 PST
Attachment 78433 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/ChangeLog', u'Source/JavaScriptCore/wtf/FastMalloc.cpp']" exit_code: 1
Source/JavaScriptCore/wtf/FastMalloc.cpp:1446:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Source/JavaScriptCore/wtf/FastMalloc.cpp:1498:  TCMalloc_PageHeap::runScavengerThread is incorrectly named. Don't use underscores in your identifier names.  [readability/naming] [4]
Source/JavaScriptCore/wtf/FastMalloc.cpp:1509:  TCMalloc_PageHeap::initializeScavenger is incorrectly named. Don't use underscores in your identifier names.  [readability/naming] [4]
Total errors found: 3 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 8 Eric Seidel (no email) 2011-01-10 13:51:57 PST
I guess we should exclude FastMalloc.cpp from the style checks.
Comment 9 Patrick R. Gansterer 2011-01-10 14:07:12 PST
(In reply to comment #8)
> I guess we should exclude FastMalloc.cpp from the style checks.
What about converting FastMalloc to WebKit style and remove all #ifdef WTF_CHANGES ?
Comment 10 Adam Roben (:aroben) 2011-01-11 05:28:31 PST
Ideally we'd move this work off to the thread pool, rather than having a dedicated thread that spends most of its time sleeping. A timer queue timer should do the trick.
Comment 11 Adam Roben (:aroben) 2011-01-11 05:29:02 PST
(In reply to comment #10)
> Ideally we'd move this work off to the thread pool, rather than having a dedicated thread that spends most of its time sleeping. A timer queue timer should do the trick.

In fact, that's what bug 45186 is about.
Comment 12 Adam Roben (:aroben) 2011-01-11 05:30:07 PST
Comment on attachment 78433 [details]
Patch

All this scavenging code is becoming an unmaintainable mess full of #ifs. We really should clean it up before we add more capabilities to it.
Comment 13 Adam Barth 2011-01-11 15:09:04 PST
Comment on attachment 78433 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=78433&action=review

> Source/JavaScriptCore/ChangeLog:8
> +        Use a windows event instead of a pthread_cond_t to signal scavenger.

This change log would be more informative if it explained why we'd like to make this change...

> Source/JavaScriptCore/wtf/FastMalloc.cpp:1506
> +#if COMPILER(MSVC)
> +    // Without this, Visual Studio will complain that this method does not return a value.
> +    return 0;
> +#endif

Why not return 0 unconditionally?  Without this line of code, this function does not return a value, which seems bad, right?
Comment 14 Patrick R. Gansterer 2011-01-11 15:14:00 PST
Comment on attachment 78433 [details]
Patch

moved main idea to bug 45186
Comment 15 Patrick R. Gansterer 2011-11-15 08:32:24 PST

*** This bug has been marked as a duplicate of bug 72098 ***