Bug 54263 - add a findRunOfZeros() method to wtf/Bitmap.h
Summary: add a findRunOfZeros() method to wtf/Bitmap.h
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Siddharth Mathur
URL:
Keywords: Qt
Depends on:
Blocks: 51128
  Show dependency treegraph
 
Reported: 2011-02-10 18:44 PST by Siddharth Mathur
Modified: 2011-02-11 13:15 PST (History)
4 users (show)

See Also:


Attachments
Patch for view (1.71 KB, patch)
2011-02-10 18:57 PST, Siddharth Mathur
darin: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Siddharth Mathur 2011-02-10 18:44:58 PST
Additional method in wtf/Bitmap.h that locates (the start index of) a run of N zeros in the bitmap. 
This will help me complete Bug 51128 without rolling my own bit map implementation.
Comment 1 Siddharth Mathur 2011-02-10 18:57:29 PST
Created attachment 82089 [details]
Patch for view

Almost brute force search through the bit array to find a run of zero bit. 

(The return type of int64_t is a bit awkward, but I wanted to return a -1 in case of "not found" while also be able to represent 2^32)
Comment 2 Darin Adler 2011-02-11 13:04:12 PST
Comment on attachment 82089 [details]
Patch for view

We don’t normally take patches that add in functions that aren’t used. For one ting, such functions can’t be tested.
Comment 3 Siddharth Mathur 2011-02-11 13:15:42 PST
OK, I will make it part of Bug 51128. Thanks.