-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
[kenel] add static name for rt_object #6422
Conversation
43d2763
to
eaf64e3
Compare
eaf64e3
to
b2e2ecc
Compare
b2e2ecc
to
32d325b
Compare
个人感觉这样改对于节省内存意义实在不大,或许可以考虑允许name为空指针,但list thread, find thread 等需要name的操作对此线程失效。 |
是有意义的,每一个object就要占用8个字节的内存。在一些ram受限严重的情况下,需要缩减。 |
可以让name 变的更短,例如 2 字节, 甚至一个字节(需要改变处理逻辑, 把name看做字符或者 0 - 255 的数字id),不是比一个指针内存占用更小 :) |
非常有道理,那这个PR的意义就不大了,可以关闭掉了。 |
Co-authored-by: a1012112796 <1012112796@qq.com>
还是有必要实现的,通过const char* 的方式可以不限制字符串的长度,而且只占用ROM,不占用RAM |
如果应用中 存在 char* 类型的 是不是就不能用这个了? cahr 会被外部改变 |
不取决于数据类型,取决于数据的内存类型,如果这个字符串是全局变量,是可以放进去的,如果是函数的局部变量是不可以的。 |
TODO:
|
拉取/合并请求描述:(PR description)
[
增加静态object 名字,用户可以根据内存实际使用情况决定使用动态还是静态。适用于资源极度受限的情况下使用。
由于没有动态拼接支持,在静态名字下,控线线程的名字在多核时将命名成相同的名字
该功能在RT-Thread完整版本中不常用,主要用于RT-Thread Nano
]
以下的内容不应该在提交PR时的message修改,修改下述message,PR会被直接关闭。请在提交PR后,浏览器查看PR并对以下检查项逐项check,没问题后逐条在页面上打钩。
The following content must not be changed in the submitted PR message. Otherwise, the PR will be closed immediately. After submitted PR, please use a web browser to visit PR, and check items one by one, and ticked them if no problem.
当前拉取/合并请求的状态 Intent for your PR
必须选择一项 Choose one (Mandatory):
代码质量 Code Quality:
我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:
#if 0
代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up