malloc_trim 函数
时间: 2023-10-29 12:21:11 浏览: 374
malloc函数的用法
malloc_trim函数是用于释放堆顶的空闲内存的。它通过调用sbrk(2)函数并传递适当的参数来尝试释放堆顶的空闲内存。如果成功释放了内存并将其返回给系统,则malloc_trim函数返回1;如果无法释放任何内存,则返回0。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* *3* [[c/c++] 堆释放](https://blog.csdn.net/ykun089/article/details/123396138)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 100%"]
[ .reference_list ]
阅读全文