Skip to content

Commit 5fff3e0

Browse files
authored
Merge pull request #480 from savi-lang/add/env-out-flush
Add `Env.OutStream.flush` behavior.
2 parents 2ce45a4 + 11e70bc commit 5fff3e0

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

core/Env.savi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,7 @@
9090
chunks.each -> (data |
9191
_FFI.pony_os_std_write(@_stream, data.cpointer, data.size)
9292
)
93+
94+
:: Ensure that all buffered data is flushed to the output stream.
95+
:be flush
96+
_FFI.pony_os_std_flush(@_stream)

core/_FFI.savi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
:ffi pony_os_std_write(
1414
fp CPointer(None)'ref, buffer CPointer(U8), length USize
1515
) None
16+
:ffi pony_os_std_flush(fp CPointer(None)'ref) None
1617

1718
:module _FFI.Cast(A, B)
1819
:: An FFI-only utility function for bit-casting type A to B.

0 commit comments

Comments
 (0)