Page 1 of 1

STL

Posted: Mon Jun 18, 2007 7:01 pm
by frank
Does anyone know of a good easy to port to kernel space STL. I have come across quite a few and they all rely heavily on exceptions and lots of headers I don't have and don't wish to create. I would like to be able to use vectors, lists, dequeues, and at least some of the associative containers. I thought I would ask before I try my hand at ripping the exceptions out and trying to make up the rest of the headers.

Thanks,
Frank

Posted: Mon Jun 18, 2007 7:54 pm
by Alboin
You could write your own. It's shouldn't be too hard. (That is, if you just write a small subset of it.)

Posted: Sat Jun 30, 2007 7:49 pm
by frank
Well does anyone have a good reference on the internals of the STL? There are plenty of good references on the interface but few on the internals.

Posted: Sat Jun 30, 2007 7:51 pm
by Kevin McGuire
Candy should know. He does a lot of reading about these types of things. He had ought to find this message is no one else replies with any good information about that sort of stuff.

Posted: Sun Jul 01, 2007 5:34 am
by bluecode
I bought "The C++ Standard - Incorporating Technical Corrigendum 1" (published by Wiley), but there is also the final Draft of the C++ Standard (also including technical corrigendum 1. Just for the record: imho in some STLs you can disable exceptions with a define or something similar.

Posted: Sun Jul 01, 2007 10:38 am
by carbonBased
SGI used to have good docs on the interfaces, and insight into the "under-workings" of the library; I used to use those sites whenever developing on top of STL, at least. I assume they would be of some use if implementing your own STL, as well (but they are mostly geared towards development on top of STL).

A searched google, and found this -- looks like the same site I remember:
http://www.sgi.com/tech/stl/

--Jeff

Re: STL

Posted: Sun Jul 01, 2007 12:13 pm
by Candy
frank wrote:Does anyone know of a good easy to port to kernel space STL. I have come across quite a few and they all rely heavily on exceptions and lots of headers I don't have and don't wish to create. I would like to be able to use vectors, lists, dequeues, and at least some of the associative containers. I thought I would ask before I try my hand at ripping the exceptions out and trying to make up the rest of the headers.
You can disable exceptions fairly easily (IIRC it's a define indeed), replacing allocation & such by your own should be trivial. Do notice what functions return when they fail without exception, because you should (must) handle those cases.

Posted: Sun Jul 01, 2007 1:41 pm
by frank
Ok now then does anyone know of a good STL implementation that I can try to port? I have downloaded a couple and most of them just fail with 100s of compiler warnings. I could try to fix them but I am developing an OS not a STL.

Posted: Sun Jul 01, 2007 1:47 pm
by Alboin
Have you tried uSTL?

Posted: Sun Jul 01, 2007 2:36 pm
by Candy
or STLPort ?

Posted: Sun Jul 01, 2007 5:30 pm
by nick8325
I ported SGI STL to my kernel before. It wasn't too hard. You can disable exceptions by editing stl_config.h; apart from that, the only problem I found was that it calls fprintf(stderr, ...) in a few places.

EDIT: I just noticed that it needs new.h. That means you have to define operator new, but the wiki explains that (under "new and delete").

Posted: Sun Jul 01, 2007 7:47 pm
by hendric
Well , I know there's a Chinese provide a simple STL (Both With C , which amazing me a lot , and C ++ ) porting to x86ã€