ReactOS 0.4.16-dev-1078-g21d3e29
_getbuf.cpp File Reference
Include dependency graph for _getbuf.cpp:

Go to the source code of this file.

Functions

void __cdecl __acrt_stdio_allocate_buffer_nolock (FILE *const public_stream)
 

Function Documentation

◆ __acrt_stdio_allocate_buffer_nolock()

void __cdecl __acrt_stdio_allocate_buffer_nolock ( FILE *const  public_stream)

Definition at line 16 of file _getbuf.cpp.

17{
18 _ASSERTE(public_stream != nullptr);
19
20 __crt_stdio_stream const stream(public_stream);
21
22 #ifndef CRTDLL
23 ++_cflush; // Force the library pre-termination procedure to run
24 #endif
25
26 // Try to get a big buffer:
27 stream->_base = _calloc_crt_t(char, _INTERNAL_BUFSIZ).detach();
28 if (stream->_base != nullptr)
29 {
30 stream.set_flags(_IOBUFFER_CRT);
31 stream->_bufsiz = _INTERNAL_BUFSIZ;
32 }
33 // If we couldn't get a big buffer, use single character buffering:
34 else
35 {
36 stream.set_flags(_IOBUFFER_NONE);
37 stream->_base = reinterpret_cast<char *>(&stream->_charbuf);
38 stream->_bufsiz = 2;
39 }
40
41 stream->_ptr = stream->_base;
42 stream->_cnt = 0;
43}
int _cflush
Definition: _file.cpp:53
#define _INTERNAL_BUFSIZ
@ _IOBUFFER_CRT
@ _IOBUFFER_NONE
#define _ASSERTE(expr)
Definition: crtdbg.h:114
Definition: parse.h:23

Referenced by __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_0(), _ungetc_nolock(), _ungetwc_nolock(), common_flush_and_write_nolock(), and common_refill_and_read_nolock().