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

void WSReleaseByteString(WSLINK link,const unsigned char *s,int n)
disowns memory allocated by WSGetByteString() to store the array of character codes s.

DetailsDetails

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

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

#include "wstp.h"

/* read a string composed of character code values 0-255 from the link and release that memory to MathLink for deallocation */

void f(WSLINK lp)
{
    const unsigned char *string;
    int length;

    if(! WSGetByteString(lp, &string, &length, 0))
        { /* unable to read byte string from lp */ }

    /* ... */

    WSReleaseByteString(lp, string, length);
}