MidiFreeSpace


Returns the available free MidiShare event space. MidiFreeSpace allows to know at any time the number of cells remaining available from the MidiShare memory manager.

pascal long    MidiFreeSpace(void);

none

The result is a 32-bit integer, the number of available free cells in the MidiShare memory manager.


Print informations about MidiShare memory space.


void PrintMemInfo(void)
{
    printf("MidiShare memory :\n");
    printf(" free space  : %i cells\n", MidiFreeSpace());
    printf(" used space  : %i cells\n", MidiTotalSpace() - MidiFreeSpace());
    printf(" total space : %i cells\n", MidiTotalSpace());
}

MidiFreeSpace inhibits all interrupts during its execution. If the remaining space is very large MidiFreeSpace can take a long time to execute and may cause overrun errors with fast incoming Midi data.