XyrisOS/xyris

Kernel Vector Library

Closed this issue · 6 comments

The kernel should have a vector library similar to that of the C++ standard library's vector. It should be templated like LinkedList and should accept a maximum size so that it can be statically allocated.

So this vector will not allow for growing and shrinking like the standard library one does?

Ideally it would, yes. Maybe there should be a base class that a dynamic and a static variation could both inherit?

That would be the "proper" OOP way to do that, but I get the feeling that it would be much more performant to have completely separate implementations that just so happen to have the same API. We'll have to experiment and see what's best.

What if it was the difference between an Array class and a Vector class? Array uses statically sized arrays and Vector used a dynamically allocated array so that it can be resized.

That sounds good in theory. I guess we'll have to play around with implementation and see how it fits.

Closing this issue as it's being rolled into #378 (XS standard library)