The Complete SPRLIB & ANNLIB

malloc_dataset

- allocate a DATASET structure

SYNOPSIS

DATASET *malloc_dataset ()

ARGUMENTS

None.

RETURNS

A pointer to a newly allocated DATASET structure if succesful, NULL otherwise.

FUNCTION

This function is used to allocate a number of DATASET structures at a time, in order to minimize operating system overhead when allocating multiple structures. It uses the malloc_local function to keep track of the allocated blocks of memory. DATASET_STOCK dataset structures are allocated at a time, and individual structures are distributed from this stock. A pointer to a linked list of free structures is maintained through FreeDataSets (see STOCK-variables) and the DATASET structure's SystemData.p field. Some default values are entered in the allocated dataset structure: the SetText field is set to a zero length string; SetId = 0, SetFlag = 0, NumInputs = NumOutputs = NumSamples = 0, InputDescr = OutputDescr = FirstSample = NULL. The SystemDataRWFlag is set to LEARNWRITE | SAMPLEWRITE - see DATASET-ACCESS-flags. Finally, the CreationDate field is set using the time_stamp routine.

NOTE

Structures allocated by this routine should be deallocated using the free_dataset function.

SEE ALSO

STOCK-values, malloc_sample, free_dataset, free_sample

This document was generated using api2html on Thu Mar 5 09:00:00 MET DST 1998