Skip to content

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

Open
@RiceChen0

Description

@RiceChen0

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionThis PR/issue needs to be discussed later

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions