From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>,
"Gerd Hoffmann" <kraxel@redhat.com>
Subject: [PATCH 2/6] hw/audio/fmopl: Move ENV_CURVE to .heap to save 32KiB of .bss
Date: Wed, 4 Mar 2020 23:18:03 +0100 [thread overview]
Message-ID: <20200304221807.25212-3-philmd@redhat.com> (raw)
In-Reply-To: <20200304221807.25212-1-philmd@redhat.com>
This buffer is only used by the adlib audio device. Move it to
the .heap to release 32KiB of .bss (size reported on x86_64 host).
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
hw/audio/fmopl.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/hw/audio/fmopl.c b/hw/audio/fmopl.c
index 173a7521f2..356d4dfbca 100644
--- a/hw/audio/fmopl.c
+++ b/hw/audio/fmopl.c
@@ -186,7 +186,7 @@ static int32_t *VIB_TABLE;
/* envelope output curve table */
/* attack + decay + OFF */
-static int32_t ENV_CURVE[2*EG_ENT+1];
+static int32_t *ENV_CURVE;
/* multiple table */
#define ML 2
@@ -1090,6 +1090,7 @@ FM_OPL *OPLCreate(int clock, int rate)
OPL->clock = clock;
OPL->rate = rate;
OPL->max_ch = max_ch;
+ ENV_CURVE = g_new(int32_t, 2 * EG_ENT + 1);
/* init grobal tables */
OPL_initialize(OPL);
/* reset chip */
@@ -1127,6 +1128,7 @@ void OPLDestroy(FM_OPL *OPL)
#endif
OPL_UnLockTable();
free(OPL);
+ g_free(ENV_CURVE);
}
/* ---------- Option handlers ---------- */
--
2.21.1
next prev parent reply other threads:[~2020-03-04 22:19 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-04 22:18 [PATCH 0/6] hw,ui: Reduce QEMU .rodata/.bss footprint Philippe Mathieu-Daudé
2020-03-04 22:18 ` [PATCH 1/6] hw/audio/fmopl: Fix a typo twice Philippe Mathieu-Daudé
2020-03-05 10:06 ` Laurent Vivier
2020-03-04 22:18 ` Philippe Mathieu-Daudé [this message]
2020-03-04 22:18 ` [PATCH 3/6] hw/usb/quirks: Use smaller types to reduce .rodata by 10KiB Philippe Mathieu-Daudé
2020-03-05 8:02 ` Gerd Hoffmann
2020-03-05 10:41 ` Philippe Mathieu-Daudé
2020-03-05 10:49 ` Philippe Mathieu-Daudé
2020-03-05 11:59 ` Gerd Hoffmann
2020-03-05 12:01 ` Philippe Mathieu-Daudé
2020-03-04 22:18 ` [PATCH 4/6] hw/audio/intel-hda: Use memory region alias to reduce .rodata by 4.34MB Philippe Mathieu-Daudé
2020-03-04 22:18 ` [PATCH 5/6] ui/curses: Make control_characters[] array const Philippe Mathieu-Daudé
2020-03-04 22:18 ` [PATCH 6/6] ui/curses: Move arrays to .heap to save 74KiB of .bss Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200304221807.25212-3-philmd@redhat.com \
--to=philmd@redhat.com \
--cc=kraxel@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).