srv_alloc

Allocates memory dynamically.

Syntax

void * srv_alloc ( DBINT size );

where

size
Specifies the number of bytes to allocate.

Returns

A pointer to the newly allocated space. If size bytes cannot be allocated, a null pointer is returned.

Remarks

Use the srv_free function to free memory allocated by srv_alloc. The srv_alloc function is provided for backward compatibility with earlier versions of Open Data Services. It is equivalent to the Win32 GlobalAlloc function. Normal Win32 or C run-time memory management functions can be used in an Open Data Services application.

See Also

This entry For information about
srv_bmove Copying bytes to memory
srv_bzero Setting memory contents to zero
srv_errhandle Listing Open Data Services errors
srv_free Freeing allocated memory
srv_getuserdata Getting a pointer to private data space in a server process