none
Kernel-compatible STL implementation RRS feed

  • Question

  • Hi,

    I'm currently looking for an STL implementation that will work within Windows kernel. To the best of my knowledge the only STL-specific issue (apart from general C++ things to take care of, such as automatic code generation etc.) is the usage of exceptions. So if an implementation doesn't use exceptions, can it be safely used within the kernel? If it's true, is there any recommended implementation?

    Thanks

    Thursday, March 17, 2016 11:42 AM

Answers

  • I know of no STL version that doesn't use exceptions, so no, there isn't a version of STL that you can use in KM

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Thursday, March 17, 2016 4:57 PM

All replies

  • I know of no STL version that doesn't use exceptions, so no, there isn't a version of STL that you can use in KM

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Thursday, March 17, 2016 4:57 PM
  • I know of no STL version that doesn't use exceptions, so no, there isn't a version of STL that you can use in KM

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    EASTL claims exceptions usage can be turned off - 

    EASTL has automatic knowledge of the compiler's enabling/disabling of exceptions. If your compiler is set to disable exceptions, EASTL automatically detects so and executes without them. Also, you can force-enable or force-disable that setting to override the automatic behavior by #defining EASTL_EXCEPTIONS_ENABLED to 0 or 1. See EASTL's config.h for more information.

    Thursday, March 17, 2016 7:49 PM
  • Have you read the readme? It says: "emphasis on high performance above all other considerations".

    For me, this turns on a red light. Robustness and ease of debugging are not in => not good for kernel, a ticking bomb.

    -- pa

    Thursday, March 17, 2016 8:48 PM
  • Never heard of EASTL until now. AFAIK, not tested for KM. Use at your own risk. What I do find with any STL discussion that doesn't use exceptions is that nearly all devs do not like the subsequent code patterns since you must now explicitly handle every error instead of letting an exception just bubble up and destroy the app. for instance, this

    list.push_back(item);

    becomes

    if (FAILED(e = list.push_back(item)) {

    // do something with e

    return error;

    }


    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Friday, March 18, 2016 3:21 AM
  • Have you read the readme? It says: "emphasis on high performance above all other considerations".

    For me, this turns on a red light. Robustness and ease of debugging are not in => not good for kernel, a ticking bomb.

    -- pa

    I'm considering to include portions on per-need basis and after thorough code inspection. But I definitely get your point.
    Friday, March 18, 2016 5:04 AM
  • Never heard of EASTL until now. AFAIK, not tested for KM. Use at your own risk. What I do find with any STL discussion that doesn't use exceptions is that nearly all devs do not like the subsequent code patterns since you must now explicitly handle every error instead of letting an exception just bubble up and destroy the app. for instance, this

    list.push_back(item);

    becomes

    if (FAILED(e = list.push_back(item)) {

    // do something with e

    return error;

    }


    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    I actually find this pattern natural, maybe it's a nuisance for developers accustomed to user-mode apps...
    Friday, March 18, 2016 5:07 AM