Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
bdd0c368
Commit
bdd0c368
authored
Jun 17, 2016
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input/async: use class HugeAllocation
parent
91769d53
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
9 deletions
+7
-9
AsyncInputStream.cxx
src/input/AsyncInputStream.cxx
+3
-4
AsyncInputStream.hxx
src/input/AsyncInputStream.hxx
+4
-1
CurlInputPlugin.cxx
src/input/plugins/CurlInputPlugin.cxx
+0
-2
NfsInputPlugin.cxx
src/input/plugins/NfsInputPlugin.cxx
+0
-2
No files found.
src/input/AsyncInputStream.cxx
View file @
bdd0c368
...
...
@@ -23,17 +23,17 @@
#include "tag/Tag.hxx"
#include "thread/Cond.hxx"
#include "IOThread.hxx"
#include "util/HugeAllocator.hxx"
#include <assert.h>
#include <string.h>
AsyncInputStream
::
AsyncInputStream
(
const
char
*
_url
,
Mutex
&
_mutex
,
Cond
&
_cond
,
void
*
_buffer
,
size_t
_buffer_size
,
size_t
_buffer_size
,
size_t
_resume_at
)
:
InputStream
(
_url
,
_mutex
,
_cond
),
DeferredMonitor
(
io_thread_get
()),
buffer
((
uint8_t
*
)
_buffer
,
_buffer_size
),
allocation
(
_buffer_size
),
buffer
((
uint8_t
*
)
allocation
.
get
(),
_buffer_size
),
resume_at
(
_resume_at
),
open
(
true
),
paused
(
false
),
...
...
@@ -45,7 +45,6 @@ AsyncInputStream::~AsyncInputStream()
delete
tag
;
buffer
.
Clear
();
HugeFree
(
buffer
.
Write
().
data
,
buffer
.
GetCapacity
());
}
void
...
...
src/input/AsyncInputStream.hxx
View file @
bdd0c368
...
...
@@ -22,6 +22,7 @@
#include "InputStream.hxx"
#include "event/DeferredMonitor.hxx"
#include "util/HugeAllocator.hxx"
#include "util/CircularBuffer.hxx"
#include "util/Error.hxx"
...
...
@@ -36,6 +37,8 @@ class AsyncInputStream : public InputStream, private DeferredMonitor {
NONE
,
SCHEDULED
,
PENDING
};
HugeAllocation
allocation
;
CircularBuffer
<
uint8_t
>
buffer
;
const
size_t
resume_at
;
...
...
@@ -68,7 +71,7 @@ public:
*/
AsyncInputStream
(
const
char
*
_url
,
Mutex
&
_mutex
,
Cond
&
_cond
,
void
*
_buffer
,
size_t
_buffer_size
,
size_t
_buffer_size
,
size_t
_resume_at
);
virtual
~
AsyncInputStream
();
...
...
src/input/plugins/CurlInputPlugin.cxx
View file @
bdd0c368
...
...
@@ -32,7 +32,6 @@
#include "util/ASCII.hxx"
#include "util/StringUtil.hxx"
#include "util/NumberParser.hxx"
#include "util/HugeAllocator.hxx"
#include "util/Error.hxx"
#include "util/Domain.hxx"
#include "Log.hxx"
...
...
@@ -75,7 +74,6 @@ struct CurlInputStream final : public AsyncInputStream {
CurlInputStream
(
const
char
*
_url
,
Mutex
&
_mutex
,
Cond
&
_cond
)
:
AsyncInputStream
(
_url
,
_mutex
,
_cond
,
HugeAllocate
(
CURL_MAX_BUFFERED
),
CURL_MAX_BUFFERED
,
CURL_RESUME_AT
),
request_headers
(
nullptr
),
...
...
src/input/plugins/NfsInputPlugin.cxx
View file @
bdd0c368
...
...
@@ -24,7 +24,6 @@
#include "lib/nfs/Domain.hxx"
#include "lib/nfs/Glue.hxx"
#include "lib/nfs/FileReader.hxx"
#include "util/HugeAllocator.hxx"
#include "util/StringCompare.hxx"
#include "util/Error.hxx"
...
...
@@ -50,7 +49,6 @@ class NfsInputStream final : public AsyncInputStream, NfsFileReader {
public
:
NfsInputStream
(
const
char
*
_uri
,
Mutex
&
_mutex
,
Cond
&
_cond
)
:
AsyncInputStream
(
_uri
,
_mutex
,
_cond
,
HugeAllocate
(
NFS_MAX_BUFFERED
),
NFS_MAX_BUFFERED
,
NFS_RESUME_AT
),
reconnect_on_resume
(
false
),
reconnecting
(
false
)
{}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment