WSReleaseByteArray()
This feature is not supported on the Wolfram Cloud.

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.

DetailsDetails

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

ExamplesExamplesopen allclose all

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