Home | History | Annotate | Download | only in include
      1 /*---------------------------------------------------------------------------*
      2  *  PStackSize.h  *
      3  *                                                                           *
      4  *  Copyright 2007, 2008 Nuance Communciations, Inc.                               *
      5  *                                                                           *
      6  *  Licensed under the Apache License, Version 2.0 (the 'License');          *
      7  *  you may not use this file except in compliance with the License.         *
      8  *                                                                           *
      9  *  You may obtain a copy of the License at                                  *
     10  *      http://www.apache.org/licenses/LICENSE-2.0                           *
     11  *                                                                           *
     12  *  Unless required by applicable law or agreed to in writing, software      *
     13  *  distributed under the License is distributed on an 'AS IS' BASIS,        *
     14  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
     15  *  See the License for the specific language governing permissions and      *
     16  *  limitations under the License.                                           *
     17  *                                                                           *
     18  *---------------------------------------------------------------------------*/
     19 
     20 #ifndef PSTACKSIZE_H
     21 #define PSTACKSIZE_H
     22 
     23 #include "PortPrefix.h"
     24 
     25 
     26 
     27 /**
     28  * Initialize the stack base.  This should be done in the main() function.
     29  * Note that the local variables of main() are not taken into account in the
     30  * stack size computation.  To overcome this problem, rewrite main() as a
     31  * simple function that first invokes PSTACK_SIZE_INIT and then invokes the
     32  * original main().
     33  */
     34 PORTABLE_API void PSTACK_SIZE_INIT();
     35 
     36 /**
     37  * Computes the current stack size.  The returned value is the number of bytes
     38  * in the stack.
     39  */
     40 PORTABLE_API size_t PSTACK_SIZE_GET();
     41 
     42 #endif
     43