---
title: Malloc和Free
description: "函数接口声明如下："
url: https://www.hikunpeng.com/document/detail/zh/kunpengboostkithistory/251RC1/accel/kunpengaccel_hmpp_06_0045.html
sourcePath: /source/zh/kunpengboostkithistory/251RC1/accel/kunpengaccel_hmpp_06_0045.html
indexId: 625de736cae48120b01cf0bbaf8b8e1a146795427f849a20a7f04eac2e589c0577
---
# Malloc和Free

函数接口声明如下：

- 申请指定类型长度数组所需内存：
  uint8_t *HMPPS_Malloc_8u(int32_t len);

  uint16_t *HMPPS_Malloc_16u(int32_t len);

  uint32_t *HMPPS_Malloc_32u(int32_t len);

  uint64_t *HMPPS_Malloc_64u(int32_t len);

  int8_t *HMPPS_Malloc_8s(int32_t len);

  int16_t *HMPPS_Malloc_16s(int32_t len);

  int32_t *HMPPS_Malloc_32s(int32_t len);

  int64_t *HMPPS_Malloc_64s(int32_t len);

  float *HMPPS_Malloc_32f(int32_t len);

  double *HMPPS_Malloc_64f(int32_t len);

  Hmpp8sc *HMPPS_Malloc_8sc(int32_t len);

  Hmpp16sc *HMPPS_Malloc_16sc(int32_t len);

  Hmpp32sc *HMPPS_Malloc_32sc(int32_t len);

  Hmpp64sc *HMPPS_Malloc_64sc(int32_t len);

  Hmpp32fc *HMPPS_Malloc_32fc(int32_t len);

  Hmpp64fc *HMPPS_Malloc_64fc(int32_t len);

- 释放内存：
  void HMPPS_Free(void* ptr);
