WSAllocParameter (C Function)

int WSAllocParameter(WSEnvironmentParameter*p,WSAllocator*a,WSDeallocator*d)

retrieves the current memory allocator and deallocator function pointers from the WSEnvironmentParameter object p and stores them in a and d.

Details

  • WSAllocParameter() returns error codes using the standard error values as returned by WSError().
  • On success WSAllocParameter() returns WSEOK.
  • WSEnvironmentParameter objects are used to control runtime characteristics of a WSTP environment.
  • WSAllocParameter() is declared in the WSTP header file wstp.h.

Examples

Basic Examples  (1)

#include "wstp.h"

/* retrieves the memory allocator and deallocator function pointers
from WSParameters */

void f(WSEnvironmentParameter p)
{
    WSAllocator a;
    WSDeallocator d;
    int result;

    result = WSAllocParameter(p, &a, &d);
    if(result != WSEOK)
        { /* unable to retrieve the memory allocator pointers */ }

    /* ... */
}