AdapterIO: add FlushBefore() to strip the beginning of the MallocIO object

by default, AdapterIO is initialized with a BMallocIO object, which will
be extended indefinitely. Flushing regularly is necessary to avoid
excessive memory usage. Tested in StreamRadio.

Change-Id: I9f3142c0a2300ad44dc54ccf6932d41c9526320b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7302
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
This commit is contained in:
Jérôme Duval
2024-01-23 09:49:17 +00:00
committed by Adrien Destugues
parent 88af15cfbd
commit 591a1d179a
2 changed files with 39 additions and 0 deletions
@@ -62,6 +62,8 @@ public:
void SeekCompleted();
status_t SetBuffer(BPositionIO* buffer);
status_t FlushBefore(off_t position);
BInputAdapter* BuildInputAdapter();
protected: