Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2f90c51d authored by Glenn Kasten's avatar Glenn Kasten
Browse files

Don't place large objects on the stack

Bug: 25020816
Change-Id: Ife4da9fc3000e645f654f2eb28b37ad3a89d61f9
(cherry picked from commit fc39dd9f653754315df3ff7f76b8a193829a76e8)
parent 3f273d10
Loading
Loading
Loading
Loading
+13 −5
Original line number Original line Diff line number Diff line
@@ -4399,8 +4399,12 @@ void AudioFlinger::MixerThread::dumpInternals(int fd, const Vector<String16>& ar
    dprintf(fd, "  AudioMixer tracks: 0x%08x\n", mAudioMixer->trackNames());
    dprintf(fd, "  AudioMixer tracks: 0x%08x\n", mAudioMixer->trackNames());


    // Make a non-atomic copy of fast mixer dump state so it won't change underneath us
    // Make a non-atomic copy of fast mixer dump state so it won't change underneath us
    const FastMixerDumpState copy(mFastMixerDumpState);
    // while we are dumping it.  It may be inconsistent, but it won't mutate!
    copy.dump(fd);
    // This is a large object so we place it on the heap.
    // FIXME 25972958: Need an intelligent copy constructor that does not touch unused pages.
    const FastMixerDumpState *copy = new FastMixerDumpState(mFastMixerDumpState);
    copy->dump(fd);
    delete copy;


#ifdef STATE_QUEUE_DUMP
#ifdef STATE_QUEUE_DUMP
    // Similar for state queue
    // Similar for state queue
@@ -6374,8 +6378,12 @@ void AudioFlinger::RecordThread::dumpInternals(int fd, const Vector<String16>& a
    dprintf(fd, "  Fast track available: %s\n", mFastTrackAvail ? "yes" : "no");
    dprintf(fd, "  Fast track available: %s\n", mFastTrackAvail ? "yes" : "no");


    // Make a non-atomic copy of fast capture dump state so it won't change underneath us
    // Make a non-atomic copy of fast capture dump state so it won't change underneath us
    const FastCaptureDumpState copy(mFastCaptureDumpState);
    // while we are dumping it.  It may be inconsistent, but it won't mutate!
    copy.dump(fd);
    // This is a large object so we place it on the heap.
    // FIXME 25972958: Need an intelligent copy constructor that does not touch unused pages.
    const FastCaptureDumpState *copy = new FastCaptureDumpState(mFastCaptureDumpState);
    copy->dump(fd);
    delete copy;
}
}


void AudioFlinger::RecordThread::dumpTracks(int fd, const Vector<String16>& args __unused)
void AudioFlinger::RecordThread::dumpTracks(int fd, const Vector<String16>& args __unused)