This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] RTOS/TM4C1294NCPDT:如何在运行时重新分配动态内存

Guru**** 2609955 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/763767/rtos-tm4c1294ncpdt-how-to-realloc-dynamic-memory-at-run-time

器件型号:TM4C1294NCPDT

工具/软件:TI-RTOS

如果我使用 Memory_alloc 来创建大小为100个块的运行时存储器、  

稍后、我想重新分配或增加150个块、我该怎么做

所有内容。  

我找不到像 realloc 这样的语法。

谢谢

Alagappan

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    您好!

    您可以使用 realloc。 TI-RTOS 提供 malloc/calloc/realloc/free 的线程安全实现。 使用这些函数后、您可以查看映射文件以确认 TI-RTOS (实际上是 SYS/BIOS)而不是编译器提供了这些函数。

    Todd