pa_win_util.c File Reference

#include <windows.h>
#include <mmsystem.h>
#include "pa_util.h"

Functions

void * PaUtil_AllocateMemory (long size)
void PaUtil_FreeMemory (void *block)
int PaUtil_CountCurrentlyAllocatedBlocks (void)
void Pa_Sleep (long msec)
void PaUtil_InitializeClock (void)
double PaUtil_GetTime (void)

Detailed Description

Win32 platform-specific support functions.

Todo:
Implement workaround for QueryPerformanceCounter() skipping forward bug. (see msdn kb Q274323).

Function Documentation

void Pa_Sleep ( long  msec  ) 

Put the caller to sleep for at least 'msec' milliseconds. This function is provided only as a convenience for authors of portable code (such as the tests and examples in the PortAudio distribution.)

The function may sleep longer than requested so don't rely on this for accurate musical timing.

void* PaUtil_AllocateMemory ( long  size  ) 
int PaUtil_CountCurrentlyAllocatedBlocks ( void   ) 

Return the number of currently allocated blocks. This function can be used for detecting memory leaks.

Note:
Allocations will only be tracked if PA_TRACK_MEMORY is defined. If it isn't, this function will always return 0.
void PaUtil_FreeMemory ( void *  block  ) 
double PaUtil_GetTime ( void   ) 

Return the system time in seconds. Used to implement CPU load functions

See also:
PaUtil_InitializeClock

Referenced by main(), PaUnixThread_New(), PaUtil_BeginCpuLoadMeasurement(), and PaUtil_EndCpuLoadMeasurement().

void PaUtil_InitializeClock ( void   ) 

Initialize the clock used by PaUtil_GetTime(). Call this before calling PaUtil_GetTime.

See also:
PaUtil_GetTime

Referenced by Pa_Initialize().


Generated for PortAudio by  doxygen1.6.1