---
title: Malloc和Free
description: "函数接口声明如下："
url: https://www.hikunpeng.com/document/detail/zh/kunpengboostkithistory/240RC1/accel/kunpengaccel_hmpp_06_0045.html
sourcePath: /source/zh/kunpengboostkithistory/240RC1/accel/kunpengaccel_hmpp_06_0045.html
indexId: a3460fb6392f1b1012ff312cca9614baf9673729f0ece9b4d794e86851eb72dd77
---
# 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);
