GetRequiredMemorySize

nn::socket::GetRequiredMemorySize Function

Syntax

size_t GetRequiredMemorySize(
     size_t bufferSizeForSockets,
     s32 maxSessions
);

Parameters

Name Description
in bufferSizeForSockets Number specified to the Initialize argument of the same name.
in maxSessions Number specified to the Initialize argument of the same name.

Return Values

The required work region size.

Description

Gets the minimum amount of working memory required to initialize the socket library.

The working region is used to allocate the AddrInfo values returned by the GetAddrInfo function, but it is also used temporarily during function calls. Because this size value is calculated with some extra space reserved, you do not usually need to be concerned about what points in time the working region is being used.

However, the required memory size does sometimes exceed the value returned by this function. This can happen, for example, if you get an AddrInfo value with the GetAddrInfo function, and then call GetAddrInfo again without using the FreeAddrInfo function to free the AddrInfo value first.

Revision History

2010/08/16
Initial version.

CONFIDENTIAL