有一段freerots里面的代码,第3,4,5,7行我没看明白,有朋友能帮忙一下吗?尤其是那个“@”。
/* Allocate the memory for the heap. */
#if configUSE_HEAP_SECTION_NAME && configCOMPILER==configCOMPILER_ARM_IAR /* << EST */
#pragma language=extended
#pragma location = configHEAP_SECTION_NAME_STRING
static uint8_t ucHeap[configTOTAL_HEAP_SIZE] @ configHEAP_SECTION_NAME_STRING;
#elif configUSE_HEAP_SECTION_NAME
static uint8_t __attribute__((section (configHEAP_SECTION_NAME_STRING))) ucHeap[configTOTAL_HEAP_SIZE];
#else
static uint8_t ucHeap[ configTOTAL_HEAP_SIZE ];
#endif
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
这应该都是编译器的扩展功能和语法,尤其是那个#pragma和__attribute__,查一下这是什么平台的代码,用的什么编译器,然后去查编译器文档吧
就是可以把变量集中放到一个段中。比如,经常访问的数据放一起,那么缓存会更加有效。