db/upnp: un-inline a few destructors

Reduce bloat.
This commit is contained in:
Max Kellermann 2014-01-23 21:17:40 +01:00
parent ec41d849bb
commit f3f5e2e162
9 changed files with 50 additions and 1 deletions

View File

@ -429,7 +429,7 @@ libdb_plugins_a_SOURCES += \
src/db/upnp/Util.cxx src/db/upnp/Util.hxx \
src/db/upnp/Action.hxx \
src/db/upnp/WorkQueue.hxx \
src/db/upnp/Object.hxx
src/db/upnp/Object.cxx src/db/upnp/Object.hxx
DB_LIBS += \
$(EXPAT_LIBS) \
$(UPNP_LIBS)

View File

@ -48,6 +48,11 @@ ContentDirectoryService::ContentDirectoryService(const UPnPDevice &device,
}
}
ContentDirectoryService::~ContentDirectoryService()
{
/* this destructor exists here just so it won't get inlined */
}
static bool
ReadResultTag(UPnPDirContent &dirbuf, IXML_Document *response, Error &error)
{

View File

@ -68,6 +68,8 @@ public:
/** An empty one */
ContentDirectoryService() = default;
~ContentDirectoryService();
/** Read a container's children list into dirbuf.
*
* @param objectId the UPnP object Id for the container. Root has Id "0"

View File

@ -27,6 +27,11 @@
#include <string.h>
UPnPDevice::~UPnPDevice()
{
/* this destructor exists here just so it won't get inlined */
}
/**
* An XML parser which constructs an UPnP device object from the
* device descriptor.

View File

@ -75,6 +75,8 @@ public:
UPnPDevice(UPnPDevice &&) = default;
UPnPDevice &operator=(UPnPDevice &&) = default;
~UPnPDevice();
/** Build device from xml description downloaded from discovery
* @param url where the description came from
* @param description the xml device description

View File

@ -31,6 +31,11 @@
#include <string.h>
UPnPDirContent::~UPnPDirContent()
{
/* this destructor exists here just so it won't get inlined */
}
gcc_pure gcc_nonnull_all
static bool
CompareStringLiteral(const char *literal, const char *value, size_t length)

View File

@ -36,6 +36,8 @@ class UPnPDirContent {
public:
std::vector<UPnPDirObject> objects;
~UPnPDirContent();
gcc_pure
UPnPDirObject *FindObject(const char *name) {
for (auto &o : objects)

25
src/db/upnp/Object.cxx Normal file
View File

@ -0,0 +1,25 @@
/*
* Copyright (C) 2003-2014 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "Object.hxx"
UPnPDirObject::~UPnPDirObject()
{
/* this destructor exists here just so it won't get inlined */
}

View File

@ -66,6 +66,9 @@ public:
UPnPDirObject() = default;
UPnPDirObject(UPnPDirObject &&) = default;
~UPnPDirObject();
UPnPDirObject &operator=(UPnPDirObject &&) = default;
void clear()