Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
div
eof
Expand Minimize
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

_get_sbh_threshold 

Returns the upper limit for the size of a memory allocation that is supported by the small-block heap.


size_t _get_sbh_threshold( void );

Returns the upper limit for the size of a memory allocation that is supported by the small-block heap.

_get_sbh_threshold gets the current threshold value for the small-block heap. The default threshold size is 1016 bytes for Windows 95, Windows 98, Windows Millennium Edition, and Windows NT 4.0 and zero for Windows 2000 and later platforms. By default, the small-block heap is not used on Windows 2000 and later platforms, though _set_sbh_threshold can be called with a nonzero value to enable the small-block heap in those instances.

Routine Required header Compatibility

_get_sbh_threshold

<malloc.h>

Windows 95, Windows 98, Windows 98 Second Edition, Windows Millennium Edition, Windows NT 4.0, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003

For more compatibility information, see Compatibility in the Introduction.

This program shows how to retrieve the upper limit for the size of a memory allocation that is supported by the small-block heap.

// crt__get_sbh_threshold.c
#include <stdio.h>
#include <malloc.h>

int main( void )
{
    size_t  sbh_threshold;

    sbh_threshold = _get_sbh_threshold();

    printf( "The upper limit for the size of a memory allocation is %d.\n", sbh_threshold);
}

Output

The upper limit for the size of a memory allocation is 0.

Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples.

Community Additions

ADD
Show:
© 2015 Microsoft