summaryrefslogtreecommitdiff
path: root/apps/plugins/puzzles/rbmalloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/puzzles/rbmalloc.c')
-rw-r--r--apps/plugins/puzzles/rbmalloc.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/apps/plugins/puzzles/rbmalloc.c b/apps/plugins/puzzles/rbmalloc.c
index 5bf914ff87..1cb903ef4f 100644
--- a/apps/plugins/puzzles/rbmalloc.c
+++ b/apps/plugins/puzzles/rbmalloc.c
@@ -14,12 +14,9 @@
14int allocs = 0; 14int allocs = 0;
15int frees = 0; 15int frees = 0;
16 16
17bool audiobuf_available = 17/* We don't load as an overlay anymore, so the audiobuf should always
18#ifndef COMBINED 18 * be available. */
19 true; 19bool audiobuf_available = true;
20#else
21 false;
22#endif
23 20
24static bool grab_audiobuf(void) 21static bool grab_audiobuf(void)
25{ 22{
@@ -29,10 +26,23 @@ static bool grab_audiobuf(void)
29 if(rb->audio_status()) 26 if(rb->audio_status())
30 rb->audio_stop(); 27 rb->audio_stop();
31 28
32 size_t sz, junk; 29 size_t sz;
30
33 void *audiobuf = rb->plugin_get_audio_buffer(&sz); 31 void *audiobuf = rb->plugin_get_audio_buffer(&sz);
34 extern char *giant_buffer; 32 extern char *giant_buffer;
35 33
34#if 0
35 /* Try aligning if tlsf crashes in add_new_area(). This is
36 * disabled now since things seem to work without it. */
37 void *old = audiobuf;
38
39 /* I'm sorry. */
40 audiobuf = (void*)((int) audiobuf & ~0xff);
41 audiobuf += 0x100;
42
43 sz -= audiobuf - old;
44#endif
45
36 add_new_area(audiobuf, sz, giant_buffer); 46 add_new_area(audiobuf, sz, giant_buffer);
37 audiobuf_available = false; 47 audiobuf_available = false;
38 return true; 48 return true;