ReactOS
0.4.16-dev-1946-g52006dd
_freebuf.cpp
Go to the documentation of this file.
1
//
2
// _freebuf.cpp
3
//
4
// Copyright (c) Microsoft Corporation. All rights reserved.
5
//
6
// Defines __acrt_stdio_free_buffer(), which releaes a buffer from a stream.
7
//
8
#include <
corecrt_internal_stdio.h
>
9
10
11
12
// Releases a buffer from a stream. If the stream is buffered and the buffer
13
// was allocated by the CRT, the space is freed. If the buffer was provided by
14
// the user, it is not freed (since we do not know how to free it).
15
extern
"C"
void
__cdecl
__acrt_stdio_free_buffer_nolock
(
FILE
*
const
public_stream)
16
{
17
_ASSERTE
(public_stream !=
nullptr
);
18
19
__crt_stdio_stream
const
stream
(public_stream);
20
21
if
(!
stream
.is_in_use())
22
return
;
23
24
if
(!
stream
.has_crt_buffer())
25
return
;
26
27
_free_crt
(
stream
->_base);
28
29
stream
.unset_flags(
_IOBUFFER_CRT
|
_IOBUFFER_SETVBUF
);
30
stream
->_base =
nullptr
;
31
stream
->_ptr =
nullptr
;
32
stream
->_cnt = 0;
33
}
__acrt_stdio_free_buffer_nolock
void __cdecl __acrt_stdio_free_buffer_nolock(FILE *const public_stream)
Definition:
_freebuf.cpp:15
__cdecl
#define __cdecl
Definition:
accygwin.h:79
__crt_stdio_stream
Definition:
corecrt_internal_stdio.h:197
corecrt_internal_stdio.h
_IOBUFFER_CRT
@ _IOBUFFER_CRT
Definition:
corecrt_internal_stdio.h:86
_IOBUFFER_SETVBUF
@ _IOBUFFER_SETVBUF
Definition:
corecrt_internal_stdio.h:88
_ASSERTE
#define _ASSERTE(expr)
Definition:
crtdbg.h:114
_free_crt
#define _free_crt
Definition:
internal_shared.h:175
_iobuf
Definition:
mbstring.h:19
stream
Definition:
parse.h:23
sdk
lib
ucrt
stdio
_freebuf.cpp
Generated on Thu Dec 4 2025 06:16:22 for ReactOS by
1.9.6