---
title: 函数：free_host
description: "| C函数原型 | aclError aclrtFreeHost(void \\*hostPtr) |"
url: "https://www.hiascend.com/document/detail/zh/Atlas200IDKA2DeveloperKit/23.0.RC2/Application%20Development%20Guide/aadgp/aclpythondevg_01_0118.html"
---

# 函数：free_host

| C函数原型 | aclError aclrtFreeHost(void \*hostPtr) |
| --- | --- |
| Python函数 | ret= acl.rt.free\_host(host\_ptr) |
| 函数功能 | 释放Host上的内存，同步接口。 acl.rt.free\_host接口只能释放通过acl.rt.malloc\_host接口申请的内存。 |
| 输入说明 | host\_ptr：int，待释放内存的对象的指针地址。 |
| 返回值说明 | ret：int，错误码。 返回0表示成功。 返回其它值表示失败。 |
| 约束说明 | 无 |
| 参考资源 | 接口调用示例，参见数据传输。 |
