Browse Source

use stack array instead of expensive malloc

ipatix 7 years ago
parent
commit
0b00bb1c4c
1 changed files with 1 additions and 2 deletions
  1. 1
    2
      src/agb_debug/agb_debug.c

+ 1
- 2
src/agb_debug/agb_debug.c View File

166
 
166
 
167
 void dprintf(const char * str, ...)
167
 void dprintf(const char * str, ...)
168
 {
168
 {
169
-    char* __outstr = malloc(256);
169
+    char __outstr[256];
170
     va_list args;
170
     va_list args;
171
     va_start(args, str);
171
     va_start(args, str);
172
     mini_vsnprintf(__outstr, 256, str, args);
172
     mini_vsnprintf(__outstr, 256, str, args);
173
     va_end(args);
173
     va_end(args);
174
     dprint(__outstr);
174
     dprint(__outstr);
175
-    free(__outstr);
176
 }
175
 }