WSReleaseByteArray()

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

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

disowns the memory allocated by WSGetByteArray() to store the array a, its dimensions dims and the heads heads.

Details

  • WSReleaseByteArray() is declared in the WSTP header file wstp.h.

Examples

Basic Examples  (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);
}

See Also

WSGetInteger32Array()  WSReleaseInteger32Array()

Tutorials