Max Kellermann
86a90daf1b
db/update/Remove: pass URI to Remove()
2016-03-18 16:57:43 +01:00
Max Kellermann
42f7df9681
db/update/Remove: reimplement as a non-blocking queue
...
This reduces overhead for two reasons:
1. calls to Remove() are non-blocking
2. RunDeferred() may work on large chunks at a time, reducing the
number of RunDeferred() calls
2016-03-18 16:43:02 +01:00
Max Kellermann
2edad38c7c
db/DatabaseListener: pass URI to OnDatabaseSongRemoved()
...
There's no point in passing a LightSong reference here; the callee is
interested only in the URI.
2016-03-18 16:22:33 +01:00
Max Kellermann
296ee4961e
sticker/Song: add _delete() overload with "const char *"
2016-03-18 16:21:26 +01:00
Max Kellermann
b1becddf11
util/StringView: add method Strip()
2016-03-18 15:40:49 +01:00
Max Kellermann
667edcd9d0
util/IterableSplitString: cheaper variant of SplitString()
2016-03-18 14:11:50 +01:00
Max Kellermann
b4e75bedf0
util/StringView: make nullptr_t constructor "constexpr"
2016-03-18 14:11:50 +01:00
Max Kellermann
5482ef5451
util/SplitString: relicense to BSD-2
2016-03-18 13:18:31 +01:00
Max Kellermann
a3afd5178c
tag/TagPool: optimize _dup_item()
...
When a reference counter is at its limit, don't allocate a new
TagPoolSlot - that would result in many TagPoolSlot instances with
ref==1. This in turn would make the linked list very very large,
which means quadratic runtime for many operations.
2016-03-14 13:08:04 +01:00
Max Kellermann
f1285a6dfd
tag/TagPool: add constexpr MAX_REF
2016-03-14 08:07:22 +01:00
Max Kellermann
cf7c1afb93
tag/TagPool: use prime number for NUM_SLOTS
2016-03-14 08:04:51 +01:00
Max Kellermann
f254831aa6
Instance: remove redundant "virtual" keywords
2016-03-10 23:16:35 +01:00
Max Kellermann
bd40c8649c
Partition: use Instance::EmitIdle()
2016-03-10 23:12:03 +01:00
Max Kellermann
7c53df2ed1
Partition: eliminate GlobalEvents.hxx, add mask constants
2016-03-10 23:10:14 +01:00
Max Kellermann
5ca6026787
Partition: use CallbackMaskMonitor, replacing class GlobalEvents::Monitor
2016-03-10 22:52:16 +01:00
Max Kellermann
483daa5882
Instance: move GlobalEvents::Monitor to Partition
...
All remaining events are specific to the Partition.
2016-03-10 22:47:47 +01:00
Max Kellermann
e2bc92d128
Instance: replace IdleMaskMonitor with CallMaskMonitor
2016-03-10 22:38:10 +01:00
Max Kellermann
5ffe3773d4
event/MaskMonitor: add variant with bound method
2016-03-10 22:37:33 +01:00
Max Kellermann
a7c68018a2
util/Callback: new utility class for callback functions
2016-03-10 20:42:19 +01:00
Max Kellermann
5ffb82993e
IdleMonitor: new class to replace GlobalEvents::IDLE
...
Use MaskMonitor to eliminate duplicate code.
2016-03-10 20:32:43 +01:00
Max Kellermann
07add0bd91
Instance: add base class which owns the EventLoop
2016-03-10 20:32:35 +01:00
Max Kellermann
9a9b6fa326
queue/Playlist: add interface QueueListener, replacing calls to idle_add()
2016-03-10 20:10:14 +01:00
Max Kellermann
ba43ec5759
queue/Playlist: remove redundant "struct" keyword
2016-03-10 20:03:45 +01:00
Max Kellermann
008a9560fe
queue/Playlist: call OnModified(), eliminate duplicate code
2016-03-10 20:03:01 +01:00
Max Kellermann
6ff01cc72c
Merge branch 'v0.19.x'
2016-03-07 14:30:43 +01:00
Max Kellermann
e140a28073
archive/iso9660: check path buffer bounds
2016-03-07 14:21:01 +01:00
Max Kellermann
de61c3b962
archive/iso9660: use a single path buffer for Visit()
...
Avoid wasting 4 kB stack per directory level.
2016-03-07 14:01:52 +01:00
Max Kellermann
c46fc4531b
archive/iso9660: move the "." and ".." checks up
2016-03-07 14:01:40 +01:00
Max Kellermann
065a9ed10f
archive/iso9660: add local variable "filename"
2016-03-07 13:57:07 +01:00
Max Kellermann
e44c0254f7
archive/iso9660: make variables more local
2016-03-07 13:15:07 +01:00
Max Kellermann
13f9f0315f
util/HugeAllocator: fix division by zero due to inverted check
...
There were two ways this could fail:
1. division by zero when sysconf(_SC_PAGESIZE)==0
2. mmap() failure because the size parameter is not aligned to page
size
Neither ever happened: sysconf() never fails, and the only caller
passes a size that is already aligned. Phew.
2016-03-06 23:53:41 +01:00
Max Kellermann
1532ffe215
protocol/ArgParser: fix range check
...
The old check
unsigned(value) > std::numeric_limits<unsigned>::max()
.. cannot ever fail.
2016-03-06 23:41:08 +01:00
Max Kellermann
b24cbc68ba
decoder/dsdiff: fix off-by-one buffer overflow
2016-03-06 23:28:29 +01:00
Max Kellermann
976fdd76c1
decoder/opus: limit tag size to 64 kB
2016-03-06 23:26:48 +01:00
Max Kellermann
bbda335e02
mixer/pulse: fix integer division rounding
2016-03-06 23:23:30 +01:00
Max Kellermann
031410c72b
Instance: add StateFile* attribute
2016-03-05 21:00:38 +01:00
Max Kellermann
710def8e38
Partition: un-inline the constructor
2016-03-05 20:51:29 +01:00
Max Kellermann
c0bda1b103
Idle: move flags to IdleFlags.hxx
2016-03-05 20:48:37 +01:00
Max Kellermann
0e87ce4680
GlobalEvents: expose the internal class
...
Move the GlobalEvents::Monitor instance into class Instance.
Eliminate all global variables.
2016-03-05 20:23:30 +01:00
Max Kellermann
b4d594eeff
Instance: embed EventLoop, no pointer
2016-03-05 20:20:12 +01:00
Max Kellermann
ce09379bae
Main: use Instance::Shutdown()
2016-03-05 20:20:12 +01:00
Max Kellermann
b27fb64317
client/ClientRead: use Instance::Shutdown()
2016-03-05 20:19:20 +01:00
Max Kellermann
099455db25
db/update/Service: convert const to constexpr
2016-03-05 20:08:01 +01:00
Max Kellermann
3146bf51e6
db/update/Service: eliminate attribute "progress"
...
Use walk!=nullptr instead.
2016-03-05 19:40:11 +01:00
Max Kellermann
b24a5e0662
Partition: add method EmitIdle()
...
Prepare for moving idle events to class Partition. Right now, it's
just a wrapper for idle_add().
2016-03-05 19:16:39 +01:00
Max Kellermann
e52ac0b187
event/MaskMonitor: new class to replace code in GlobalEvents and Idle
2016-03-05 19:15:50 +01:00
Max Kellermann
eaa1590866
GlobalEvents: eliminate SHUTDOWN, use Instance::Shutdown() instead
2016-03-05 18:56:27 +01:00
Max Kellermann
071af004bd
GlobalEvents: include cleanup
2016-03-05 18:56:27 +01:00
Max Kellermann
23ab4e5e5f
Instance: add method Shutdown()
2016-03-05 18:56:16 +01:00
Max Kellermann
8e563cbccd
Instance: use C++11 initializers
2016-03-05 18:55:57 +01:00