[apps] Apps are not allocated on the heap anymore but in a union hold by

the AppsContainerStorage
This commit is contained in:
Émilie Feral
2018-09-05 18:05:41 +02:00
parent ea948117a4
commit 9182d66fcc
16 changed files with 45 additions and 30 deletions

View File

@@ -13,7 +13,18 @@ public:
AppsContainerStorage();
int numberOfApps() override;
App::Snapshot * appSnapshotAtIndex(int index) override;
void * currentAppBuffer() override { return &m_apps; };
private:
union Apps {
public:
/* Enforce a trivial constructor and destructor that just leave the memory
* unmodified. This way, m_apps can be trivially destructed. */
Apps() {};
~Apps() {};
private:
APPS_CONTAINER_APPS_DECLARATION
};
Apps m_apps;
APPS_CONTAINER_SNAPSHOT_DECLARATIONS
};