OpenersNotesSection(Spacer1)Details

The environment parameter object e must have been created by a call to (NonWLLink[MLNewParameters(), paclet:/ref/c/MLNewParameters]).

MLReleaseParameters() is declared in the MathLink header file (RefLink[mathlink.h, paclet:/ref/file/mathlink.h]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (1)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

#include "mathlink.h"

void * Alloc(unsigned long l)
{
	/* ... */
}

void Free(void *m)
{
	/* ... */
}


int main()
{
	MLEnvironmentParameter ep;
	MLENV env;

	ep = MLNewParameters(MLREVISION, MLAPIREVISION);
	if(ep == (MLEnvironmentParameter)0)
	{ /* Unable to create a new environment parameter object */ }

	MLSetAllocParameter(ep, Alloc, Free);

	env = MLInitialize(ep);
	if(env == (MLENV)0)
	{ /* Unable to initialize environment object */ }

	MLReleaseParameters(ep);

	/* ... */

	MLDeinitialize(env);

	return 0;
}

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(NonWLLink[MLNewParameters(), paclet:/ref/c/MLNewParameters])  ▪  (NonWLLink[MLAllocParameter(), paclet:/ref/c/MLAllocParameter])  ▪  (NonWLLink[MLSetAllocParameter(), paclet:/ref/c/MLSetAllocParameter])  ▪  (NonWLLink[MLSetThreadSafeLinksParameter(), paclet:/ref/c/MLSetThreadSafeLinksParameter])}})}})