现在的位置: 首页 > 综合 > 正文

windows mobile rapidxml

2013年11月05日 ⁄ 综合 ⁄ 共 954字 ⁄ 字号 评论关闭

rapidxml在windows mobile崩溃,代码

xml_document<> docflowform;

原因:rapidxml内存池默认值过大。。在mobile上申请不成功

解决:

rapidxml.hpp

#ifndef RAPIDXML_STATIC_POOL_SIZE
    // Size of static memory block of memory_pool.
    // Define RAPIDXML_STATIC_POOL_SIZE before including rapidxml.hpp if you want to override the default value.
    // No dynamic memory allocations are performed by memory_pool until static memory is exhausted.
    //#define RAPIDXML_STATIC_POOL_SIZE (64 * 1024)
    #define RAPIDXML_STATIC_POOL_SIZE (16 * 1024)
#endif

#ifndef RAPIDXML_DYNAMIC_POOL_SIZE
    // Size of dynamic memory block of memory_pool.
    // Define RAPIDXML_DYNAMIC_POOL_SIZE before including rapidxml.hpp if you want to override the default value.
    // After the static block is exhausted, dynamic blocks with approximately this size are allocated by memory_pool.
    //#define RAPIDXML_DYNAMIC_POOL_SIZE (64 * 1024)
    #define RAPIDXML_DYNAMIC_POOL_SIZE (16 * 1024)
#endif

参考:http://stackoverflow.com/questions/7311323/strange-exceptions-using-rapidxml-under-windows-ce-6-0-windows-mobile-windows-em

抱歉!评论已关闭.