RT-Thread / RT-Thread/rt-thread
[Feature] Memory pool free interface need to add a handle
Open
Nobody has claimed this yet.
discussion
- Dominant language
- C
- Stars
- 12.2k
- Forks
- 5.4k
- Avg merge
- 4d 12h
- Merged PRs (30d)
- 40
Description
Describe problem solved by the proposed feature
- 目前内存池的申请接口是带句柄,释放接口是不带句柄的
- 内容池的数据块要求没有block都要额外的增加4个字节,他的目的其实是为了在malloc的时候保存当前对象句柄。在free的时候,还原句柄,然后归还block。
- 从上面的角度去看,每个block都浪费4个字节(浪费空间),free的时候还需要额外的还原句柄(浪费时间)
Describe your preferred solution
free接口增加句柄的好处
- 节省每个block的额外的4个字节。
- 明确了释放接口的内存对象句柄。
- 释放空间能节省时间
Describe possible alternatives
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files, tests, or API entry points are named in the issue. Start by locating the memory-pool allocation and free interfaces, then trace their callers and existing tests. Done means the free interface accepts the handle, preserves the intended memory-pool behavior, and verifies the stated per-block space and release-time improvements.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- embedded-iot, operating-systems
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100