Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

你好,关于HAS_STD_MALLOC #1

Open
zq190kg opened this issue May 16, 2020 · 3 comments
Open

你好,关于HAS_STD_MALLOC #1

zq190kg opened this issue May 16, 2020 · 3 comments

Comments

@zq190kg
Copy link

zq190kg commented May 16, 2020

我定义了HAS_STD_MALLOC,用原本单片机系统的malloc,但运行过程中,发现有些malloc返回null,例如 asset_info_t* info = TKMEM_ALLOC(sizeof(asset_info_t) + size);
return_value_if_fail(info != NULL, NULL);
load资源的时候,就会出现info malloc失败的情况。

@xianjimli
Copy link
Member

HAS_STD_MALLOC是在哪里定义的。

@zq190kg
Copy link
Author

zq190kg commented May 18, 2020


keil 项目属性 C++->DEFINE哪里,定义HAS_AWTK_CONFIG,HAS_STD_MALLOC
有些info申请内存时成功,有些就返回null

@xianjimli
Copy link
Member

你在tk_alloc_impl函数里设置断点,看看什么时候分配失败。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants