RT-Thread / RT-Thread/rt-thread

[Feature] Memory pool free interface need to add a handle

Open
#9,757 6 comments 0 reactions 0 assignees View on GitHub

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
  1. 目前内存池的申请接口是带句柄,释放接口是不带句柄的
  2. 内容池的数据块要求没有block都要额外的增加4个字节,他的目的其实是为了在malloc的时候保存当前对象句柄。在free的时候,还原句柄,然后归还block。
  3. 从上面的角度去看,每个block都浪费4个字节(浪费空间),free的时候还需要额外的还原句柄(浪费时间)
Describe your preferred solution

free接口增加句柄的好处

  1. 节省每个block的额外的4个字节。
  2. 明确了释放接口的内存对象句柄。
  3. 释放空间能节省时间
Describe possible alternatives

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.