【问题标题】:#pragma AVRT_CODE_BEGIN - what does it mean?#pragma AVRT_CODE_BEGIN - 这是什么意思?
【发布时间】:2012-04-28 15:40:19
【问题描述】:

我维护了一些代码,例如:

#pragma AVRT_CODE_BEGIN   
//some code
#pragma AVRT_CODE_END

我听不懂,
我用谷歌搜索了它,但什么也没得到,除了代码示例:Click me
请问您知道AVRT_CODE_BEGIN和AVRT_CODE_END是什么意思吗?
请告诉我。非常感谢。

【问题讨论】:

  • 我认为这是对编译器使用“实时”性能约束(例如处理音频)优化代码的提示。但我不知道它的真正作用。

标签: c++ visual-studio visual-c++


【解决方案1】:

有编译器指令可以将代码发送到特定的链接器段,而不是默认的链接器段,以便使用 AVRT 库进行音频处理。它似乎是 Microsoft 的内部功能。这些段的存在可能是为了优化或安全。我发现这个头文件说明了意思:

ftp://ns432777.ip-37-59-27.eu/Program%20Files%20%28x86%29/Windows%20Kits/8.0/Include/um/baseaudioprocessingobject.h

// These are copied out of the old AvRt.h file.
#define AVRT_CODE_BEGIN   code_seg( push, "RT_CODE" )
#define AVRT_DATA_BEGIN   data_seg( push, "RT_DATA" )
#define AVRT_BSS_BEGIN    bss_seg( push, "RT_BSS" )
#define AVRT_CONST_BEGIN  const_seg( push, "RT_CONST" )
#define AVRT_VTABLES_BEGIN AVRT_CONST_BEGIN
#define AVRT_CODE_END   code_seg( pop )
#define AVRT_DATA_END   data_seg( pop )
#define AVRT_BSS_END    bss_seg( pop )
#define AVRT_CONST_END  const_seg( pop )
#define AVRT_VTABLES_END AVRT_CONST_END
#define AVRT_DATA __declspec(allocate("RT_DATA"))
#define AVRT_BSS __declspec(allocate("RT_BSS"))
#define AVRT_CONST __declspec(allocate("RT_CONST"))

【讨论】:

    猜你喜欢
    • 2022-01-04
    • 1970-01-01
    • 2011-03-29
    • 2010-12-27
    • 2013-08-17
    • 2011-09-04
    相关资源
    最近更新 更多