Displaying 2 results from an estimated 2 matches for "smallcapacity".
2018 Jun 21
4
RFC: Should SmallVectors be smaller?
...have the right speed/memory tradeoff. It would be straightforward to shave off a couple of pointers (1 pointer/4B on 32-bit; 2 pointers/16B on 64-bit) if users could afford to test for small-mode vs. large-mode.
The current scheme works out to something like this:
```
template <class T, size_t SmallCapacity>
struct SmallVector {
T *BeginX, *EndX, *CapacityX;
T Small[SmallCapacity];
bool isSmall() const { return BeginX == Small; }
T *begin() { return BeginX; }
T *end() { return EndX; }
size_t size() const { return EndX - BeginX; }
size_t capacity() const { return CapacityX - BeginX; }...
2018 Jun 22
3
RFC: Should SmallVectors be smaller?
...t doesn’t hurt runtime performance in practice, there’s no reason to fork the data structure.
If no one has measured before I might try it some time.
> -Chris
>
>
>>
>> The current scheme works out to something like this:
>> ```
>> template <class T, size_t SmallCapacity>
>> struct SmallVector {
>> T *BeginX, *EndX, *CapacityX;
>> T Small[SmallCapacity];
>>
>> bool isSmall() const { return BeginX == Small; }
>> T *begin() { return BeginX; }
>> T *end() { return EndX; }
>> size_t size() const { return EndX - BeginX...