STACK_ALLOC man page on NetBSD

Man page or keyword search:  
man Server   9087 pages
apropos Keyword Search (all sections)
Output format
NetBSD logo
[printable version]

STACK(9)		 BSD Kernel Developer's Manual		      STACK(9)

NAME
     STACK — stack macros

SYNOPSIS
     #include <sys/param.h>

     type
     STACK_ALLOC(sp, size);

     type
     STACK_MAX(sp, size);

     type
     STACK_ALIGN(sp, bytes);

     type
     STACK_GROW(sp, size);

     type
     STACK_SHRINK(sp, size);

DESCRIPTION
     A stack is an area of memory with a fixed origin but with a variable
     size.  A stack pointer points to the most recently referenced location on
     the stack.	 Initially, when the stack has a size of zero, the stack
     pointer points to the origin of the stack.	 When data items are added to
     the stack, the stack pointer moves away from the origin.

     The STACK_ALLOC() macro returns a pointer to allocated stack space of
     some size.	 Given the returned pointer sp and size, STACK_MAX() returns
     the maximum stack address of the allocated stack space.  The
     STACK_ALIGN() macro can be used to align the stack pointer sp by the
     specified amount of bytes.

     Two basic operations are common to all stacks: a data item is added
     (“push”) to the location pointed by sp or a data item is removed (“pop”)
     from the stack.  The stack pointer must be subsequently adjusted by the
     size of the data item.  The STACK_GROW() and STACK_SHRINK() macros adjust
     the stack pointer sp by given size.

     A stack may grow either up or down.  The described macros take this into
     account by using the __MACHINE_STACK_GROWS_UP preprocessor define.

SEE ALSO
     param(3), queue(3)

BSD				 April 8, 2011				   BSD
[top]
                             _         _         _ 
                            | |       | |       | |     
                            | |       | |       | |     
                         __ | | __ __ | | __ __ | | __  
                         \ \| |/ / \ \| |/ / \ \| |/ /  
                          \ \ / /   \ \ / /   \ \ / /   
                           \   /     \   /     \   /    
                            \_/       \_/       \_/ 
More information is available in HTML format for server NetBSD

List of man pages available for NetBSD

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net