WSReleaseByteArray (C 函数)

As of Version 10.0, WSReleaseByteArray() has been superseded by WSReleaseInteger8Array().

void WSReleaseByteArray(WSLINK link,unsigned char *a,int *dims,char **heads,int d)

释放 WSGetByteArray() 分配的内存来储存数组 a、它的维数 dims 及其标头 heads.

更多信息

  • WSTP 的标头文件 wstp.h 已对 WSReleaseByteArray() 作出声明.

范例

基本范例  (1)

#include "wstp.h"

/* read an array of integers each of size 1 byte and then release that memory to WSTP for deallocation */

void f(WSLINK lp)
{
    unsigned char *data;
    int *dimensions;
    char **heads;
    int depth;

    if(! WSGetByteArray(lp, &data, &dimensions, &heads, &depth))
        { /* unable to read array from lp */ }

    /* ... */

    WSReleaseByteArray(lp, data, dimensions, heads, depth);
}