WSReleaseReal32Array (C Function)

void WSReleaseReal32Array(WSLINK link,float *a,int *dims,char **heads,int d)

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


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


Basic Examples  (1)

#include "wstp.h"

/* read an array of single-precision floating-point numbers from a link and then release the memory to WSTP for deallocation */

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

    if(! WSGetReal32Array(lp, &data, &dimensions, &heads))
        { /* Unable to get the array from lp */ }

    /* ... */

    WSReleaseReal32Array(lp, data, dimensions, heads, depth);