---
title: KqMallocGetVersion
description: "获取KQMalloc产品版本信息。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengboostkithistory/2300/accel/kunpengaccel_ksl_16_0026.html
sourcePath: /source/zh/kunpengboostkithistory/2300/accel/kunpengaccel_ksl_16_0026.html
indexId: b47d2f7bb373c513d73bbe871cc649e90eb49f02b9156362888966bac4e27f4274
---
# KqMallocGetVersion

获取KQMalloc产品版本信息。

KqMallocResult KqMallocGetVersion(KqMallocProVersion *packageInfo);

#### 参数

| 参数名 | 描述 | 取值范围 | 输入/输出 |
| --- | --- | --- | --- |
| packageInfo | 指向产品信息结构体的指针。 | 非空 | 输出 |


#### 返回值

- 成功：返回KQMALLOC_STS_NO_ERR。
- 失败：返回错误码。


#### 错误码

| 错误码 | 描述 |
| --- | --- |
| KQMALLOC\_STS\_NULL\_PTR\_ERR | KqMallocProVersion指针为空指针。 |


#### 示例

```
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include "kqmalloc.h"
void GetProductVersionExample()
{
KqMallocProVersion versionGet;
KqMallocResult result = KqMallocGetVersion(&versionGet);
if (result == KQMALLOC_STS_NO_ERR) {
printf("Product Name: %s\n", versionGet.productName);
printf("Product Version: %s\n", versionGet.productVersion);
printf("Component Name: %s\n", versionGet.componentName);
printf("Component Version: %s\n", versionGet.componentVersion);
printf("Component AppendInfo: %s\n", versionGet.componentAppendInfo);
printf("Software Name: %s\n", versionGet.softwareName);
printf("Software Version: %s\n", versionGet.softwareVersion);
}
}
int main(void) {
GetProductVersionExample();
return 0;
}
```

运行结果：

```
Product Name: Kunpeng Boostkit
Product Version: 23.0.0
Component Name: BoostKit-ksl
Component Version: 2.1.0
Component AppendInfo: gcc
Software Name: boostkit-ksl-kqmalloc
Software Version: 2.1.0
```

以上版本号和编译时间以实际运行结果为准，上述结果仅供参考。
