Bug 6894 - add a Vector class
Summary: add a Vector class
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Maciej Stachowiak
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-28 18:05 PST by Maciej Stachowiak
Modified: 2006-01-28 20:16 PST (History)
1 user (show)

See Also:


Attachments
implement Vector (30.64 KB, patch)
2006-01-28 18:09 PST, Maciej Stachowiak
hyatt: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Maciej Stachowiak 2006-01-28 18:05:48 PST
We could use a good Vector class to replace Array, QPtrVector, QValueVector, and one-off hacks to do resizable buffers or static stack buffers. Attached is my first cut at this. It should be really efficient for both POD and non-POD types, and supports an inline buffer for "fixed-size stack buffer" use cases.

Potentially useful things that are not in this version (yet):

- detecting allocation failures
- versions of fill, the constructor and append which take start and end iterators
- fill-style append
- swap
- generalized insert/remove (won't add these until it is clear they are needed)
- reverse iterators (is this really at all useful?)
- optional bounds checking w/ compile time switch
- debug mode iterator checking like for HashTable
Comment 1 Maciej Stachowiak 2006-01-28 18:09:49 PST
Created attachment 6055 [details]
implement Vector
Comment 2 Dave Hyatt 2006-01-28 18:15:04 PST
Comment on attachment 6055 [details]
implement Vector

r=me, since you're turning it on and actually using it, make sure to run perf tests.  We want to be really sure it's fast.