23 Dec 2004 00:01
[PATCH] wavefront: reduce stack usage
Randy.Dunlap <rddunlap <at> osdl.org>
2004-12-22 23:01:06 GMT
2004-12-22 23:01:06 GMT
Reduce local stack usage in wavefront_load_gus_patch()
from 984 bytes to 140 bytes (on x86-32) by using kmalloc()
instead of stack for these 840 bytes:
wavefront_patch_info samp, pat, prog; // 3 * 280
Signed-off-by: Randy Dunlap <rddunlap <at> osdl.org>
diffstat:=
sound/oss/wavfront.c | 56 +++++++++++++++++++++++++++++++--------------------
1 files changed, 35 insertions(+), 21 deletions(-)
diff -Naurp ./sound/oss/wavfront.c~wavfront_stack ./sound/oss/wavfront.c
--- ./sound/oss/wavfront.c~wavfront_stack 2004-10-18 14:54:32.000000000 -0700
+++ ./sound/oss/wavfront.c 2004-12-22 14:44:22.330034016 -0800
<at> <at> -1516,45 +1516,56 <at> <at> wavefront_load_gus_patch (int devno, int
int offs, int count, int pmgr_flag)
{
struct patch_info guspatch;
- wavefront_patch_info samp, pat, prog;
+ wavefront_patch_info *samp, *pat, *prog;
wavefront_patch *patp;
wavefront_sample *sampp;
wavefront_program *progp;
int i,base_note;
long sizeof_patch;
+ int rc = -ENOMEM;
+
+ samp = kmalloc(3 * sizeof(wavefront_patch_info), GFP_KERNEL);
(Continue reading)
RSS Feed