Commit Graph

30 Commits

Author SHA1 Message Date
Max Kellermann
148aca23be use SPDX IDs, replacing the long copyright headers 2023-03-06 14:59:48 +01:00
Max Kellermann
cc0def15c4 Copyright year 2022 2022-07-14 17:59:35 +02:00
Max Kellermann
58a345d346 MusicBuffer: set VMA name
Shows the name in /proc/PID/maps, e.g.:

 7fa57b000000-7fa57c000000 rw-p 00000000 00:00 0                          [anon:MusicBuffer]
2022-04-26 20:44:36 +02:00
Rosen Penev
29ae84e199 manual braced init
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-11-22 23:30:04 -08:00
Rosen Penev
4e0e4c00bf treewide: replace lock_guard with scoped_lock
SonarLint reports the latter to be better:

std::scoped_lock basically provides the same feature as std::lock_guard,
but is more generic: It can lock several mutexes at the same time, with a
deadlock prevention mechanism (see {rule:cpp:S5524}). The equivalent code
to perform simultaneous locking with std::lock_guard is significantly more
complex. Therefore, it is simpler to use std::scoped_lock all the time,
even when locking only one mutex (there will be no performance impact).

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-11-11 17:13:03 -08:00
Max Kellermann
5348f8c9c8 copyright year 2021 2021-01-01 19:54:28 +01:00
Rosen Penev
ab9f5d2067
replace assert.h with cassert
The former was deprecated with C++14.

According to the C++11 and C++17 standards, both files are identical.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12 15:25:38 -07:00
Max Kellermann
2817bf9e95 copyright year 2020 2020-01-18 19:23:49 +01:00
Max Kellermann
a139279575 Copyright year 2019 2019-06-17 11:17:30 +02:00
Max Kellermann
ce49d99c2f check.h: remove obsolete header
Since we switched from autotools to Meson in commit
94592c1406, we don't need to include
`config.h` early to properly enable large file support.  Meson passes
the required macros on the compiler command line instead of defining
them in `config.h`.

This means we can include `config.h` at any time, whenever we want to
check its macros, and there are no ordering constraints.
2018-11-19 16:33:49 +01:00
Max Kellermann
0e2c597884 MusicBuffer: remove noexcept from constructor
The `SliceBuffer` constructor can throw.
2018-09-21 17:11:52 +02:00
Max Kellermann
eb93bebbc1 MusicBuffer: fix potential deadlock while cross-fading in Return() 2018-06-23 18:39:50 +02:00
Max Kellermann
54d295c247 MusicChunkPtr: managed MusicChunk pointer
Make all uses of MusicChunk safe.
2018-06-22 23:11:52 +02:00
Max Kellermann
71f0ed8b74 *: add "noexcept" to many, many function prototypes
This eliminates some overhead, because the compiler doesn't need to
consider these functions throwing.
2017-05-08 14:44:49 +02:00
Max Kellermann
5900253b85 update copyright year 2017-01-03 20:48:59 +01:00
Max Kellermann
2e182e84c3 thread/Mutex: remove ScopeLock, use std::lock_guard directly 2017-01-03 07:11:57 +01:00
Max Kellermann
ef053035d0 util/HugeAllocator: throw std::bad_alloc on error 2016-06-17 17:57:40 +02:00
Max Kellermann
1d67aa7bf2 update copyright year to 2016 2016-02-26 17:54:05 +01:00
Max Kellermann
712ed555e6 Copyright year 2015 2015-01-01 19:48:13 +01:00
Max Kellermann
c94b4466d5 MusicChunk: rename struct to MusicChunk 2014-08-12 15:56:41 +02:00
Max Kellermann
4f83c60296 copyright year 2014 2014-01-13 22:31:55 +01:00
Max Kellermann
3216f4b257 MusicBuffer: expose the C++ API 2013-09-26 22:21:56 +02:00
Max Kellermann
b70d38dc10 Makefile.am: move sources to libsystem.a 2013-08-07 10:31:31 +02:00
Max Kellermann
a27d105dcd FatalError: new library to replace mpd_error.h 2013-08-07 10:08:36 +02:00
Max Kellermann
efbfe66f21 Mutex: new wrapper for std::mutex, replaces GMutex 2013-01-04 21:24:29 +01:00
Max Kellermann
223b90d0d4 MusicBuffer: return memory to kernel when stopping playback
Use the new HugeAllocator as backend for SliceBuffer and call
HugeDiscard() when the last chunk was returned.
2013-01-04 20:48:28 +01:00
Max Kellermann
e3a2bd3a1e MusicBuffer: move code to template class SliceBuffer 2013-01-04 17:12:21 +01:00
Max Kellermann
f0be6a4b9e MusicBuffer: allocate with new/delete 2013-01-04 17:03:50 +01:00
Max Kellermann
bdab5d5f6e MusicBuffer: disable memory poisoning
This is harmful for memory usage, because it forces the kernel to
allocate physical memory, even before playback has started.  No bug
has been found in a few years with this, so it's safe to assume that
this code is not necessary.
2013-01-04 15:42:15 +01:00
Max Kellermann
22f0a1547c buffer, pipe: convert to C++ 2013-01-04 10:16:16 +01:00