The “allocate” Declaration Specifier


Within a __declspec, this specifier is

allocate ( "segname" )

It is a syntax error (C2059) if the first token after allocate is not an opening parenthesis or the next token is not a string (for segname). It is an error (C2341) if segname is invalid (see below). It is a syntax error (C2059) if the token after segname is not a closing parenthesis.

A valid segname is either of the predefined values _CODE and _DATA or the name of a known section (as declared through various #pragma directives).