[Webkit-unassigned] [Bug 224726] New: Make container naming a bit more consistent

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Apr 17 20:12:50 PDT 2021


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

            Bug ID: 224726
           Summary: Make container naming a bit more consistent
           Product: WebKit
           Version: Other
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Web Template Framework
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: sam at webkit.org

We have a bunch of array-like/adjacent container classes in WTF and we don't have super consistent naming. Currently we have:

Vector/VectorBuffer
- Supports dynamic size changing (append, insert, etc.)
- Supports optional inline capacity
- Size & capacity are stored in struct

SegmentedVector
- Supports dynamic size changing (append, insert, etc.)
- No inline capacity
- Size & capacity are stored in struct
* Uses segments to grow so pointers to element remain valid on growth

ConcurrentVector
- Supports dynamic size changing (append, insert, etc.), though no getting smaller.
- No inline capacity
- Size & capacity are stored in struct
* Uses segments to grow so pointers to element remain valid on growth
* Uses ConcurrentBuffer to store segments for concurrency guarantees

ConcurrentBuffer
- Supports dynamic size changing (append, insert, etc.), though no getting smaller.
- No inline capacity
- Size is stored in header of buffer
* Keeps all allocated buffers (one for each time it was grown) until destructor is called

RefCountedArray
- No dynamic size changing. Size fixed at construction / assignment.
- No inline capacity
- Size is stored in header of buffer
* Use refcount in header of buffer to allow copying to become an alias
* Word sized when empty

FixedVector
- No dynamic size changing. Size fixed at construction / assignment.
- No inline capacity
- Size is stored in header of buffer
* Word sized when empty


[There are others, including Deque, BitVector, FastBitVector, UniqueArray (and perhaps others I am missing) but they are different enough to not seem relevant for this.]

That gives us the following words to play with:

- Vector
- Buffer
- RefCounted
- Fixed
- Array
- Concurrent
- Segmented


Some initial thoughts on potential important traits that should probably play into naming:

- Does it support dynamic size changing?
- What is the size when empty? (e.g. does it just store a pointer to a header + buffer)?
- Does it alias on copy?
- Does it support a concurrency related use case? 


I think we could make these more consistent.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210418/d0886439/attachment.htm>


More information about the webkit-unassigned mailing list