diff -r 43e37759235e -r 51a74ef9ed63 Symbian3/SDK/Source/GUID-27AAD3D5-AEC0-5A33-B14A-2E8B8D21CDAA.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/SDK/Source/GUID-27AAD3D5-AEC0-5A33-B14A-2E8B8D21CDAA.dita Wed Mar 31 11:11:55 2010 +0100 @@ -0,0 +1,28 @@ + + + + + +How +to use the trailing-C naming conventionThis document describes how functions named with a trailing C are +handled on the stack. +

The case of allocating an object and pushing it to the cleanup stack is +sufficiently common that allocation functions are often coded to do both in +a single operation. For example, there is a User::AllocLC() whose +semantics are to call User::Alloc() to allocate the memory, +leave if the allocation failed, and push to the cleanup stack if it succeeded.

+

The trailing C indicates that the item is pushed to the +cleanup stack if successfully allocated: the resulting function can be referred +to as a C function: in the great majority of cases, C functions +are also L functions. Any function which calls User::AllocLC() to +allocate a buffer should also use this naming convention.

+

The function that calls a -C function must pop (and destroy, +if the -C function allocated an object) the object from the +stack when its use is complete.

+
\ No newline at end of file