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
53a4de35
Commit
53a4de35
authored
Dec 28, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
util/DynamicFifoBuffer: add `noexcept`
parent
22e6d95c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
DynamicFifoBuffer.hxx
src/util/DynamicFifoBuffer.hxx
+7
-7
No files found.
src/util/DynamicFifoBuffer.hxx
View file @
53a4de35
/*
* Copyright
(C) 2003-2015
Max Kellermann <max.kellermann@gmail.com>
* Copyright
2003-2018
Max Kellermann <max.kellermann@gmail.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
...
...
@@ -45,9 +45,9 @@ public:
typedef
typename
ForeignFifoBuffer
<
T
>::
const_pointer_type
const_pointer_type
;
typedef
typename
ForeignFifoBuffer
<
T
>::
Range
Range
;
explicit
DynamicFifoBuffer
(
size_type
_capacity
)
explicit
DynamicFifoBuffer
(
size_type
_capacity
)
noexcept
:
ForeignFifoBuffer
<
T
>
(
new
T
[
_capacity
],
_capacity
)
{}
~
DynamicFifoBuffer
()
{
~
DynamicFifoBuffer
()
noexcept
{
delete
[]
GetBuffer
();
}
...
...
@@ -63,7 +63,7 @@ public:
using
ForeignFifoBuffer
<
T
>::
Write
;
using
ForeignFifoBuffer
<
T
>::
Append
;
void
Grow
(
size_type
new_capacity
)
{
void
Grow
(
size_type
new_capacity
)
noexcept
{
assert
(
new_capacity
>
GetCapacity
());
T
*
old_data
=
GetBuffer
();
...
...
@@ -72,7 +72,7 @@ public:
delete
[]
old_data
;
}
void
WantWrite
(
size_type
n
)
{
void
WantWrite
(
size_type
n
)
noexcept
{
if
(
ForeignFifoBuffer
<
T
>::
WantWrite
(
n
))
/* we already have enough space */
return
;
...
...
@@ -91,7 +91,7 @@ public:
* Write data to the buffer, growing it as needed. Returns a
* writable pointer.
*/
pointer_type
Write
(
size_type
n
)
{
pointer_type
Write
(
size_type
n
)
noexcept
{
WantWrite
(
n
);
return
Write
().
data
;
}
...
...
@@ -99,7 +99,7 @@ public:
/**
* Append data to the buffer, growing it as needed.
*/
void
Append
(
const_pointer_type
p
,
size_type
n
)
{
void
Append
(
const_pointer_type
p
,
size_type
n
)
noexcept
{
std
::
copy_n
(
p
,
n
,
Write
(
n
));
Append
(
n
);
}
...
...
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