WLReleaseByteSymbol (C 函数)

void WSReleaseByteSymbol(WSLINK link,const unsigned char *s,int len)

释放由 WSGetByteSymbol() 分配的内存以存储对应于一个符号名称的字符字符串 s.

更多信息

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

范例

基本范例  (1)

#include "wstp.h"

/* read a symbol from a link and then release the memory to WSTP for deallocation */

void f(WSLINK lp)
{
    unsigned char *sym;
    int len;

    if(! WSGetByteSymbol(lp, &sym, &len))
        { /* unable to read a symbol from lp */ }

    /* ... */

    WSReleaseByteSymbol(lp, sym, len);
}