Commit 40cc1302 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

decomp: avoid large stack allocation

(It could be more efficient, but who cares? pipe overhead is probably
 worse)
parent 072b0670
...@@ -111,7 +111,10 @@ static void *Thread (void *data) ...@@ -111,7 +111,10 @@ static void *Thread (void *data)
break; break;
vlc_cleanup_push (cleanup_mmap, buf); vlc_cleanup_push (cleanup_mmap, buf);
#else #else
unsigned char buf[bufsize]; unsigned char *buf = malloc (bufsize);
if (unlikely(buf == NULL))
break;
vlc_cleanup_push (free, buf);
#endif #endif
len = stream_Read (stream->p_source, buf, bufsize); len = stream_Read (stream->p_source, buf, bufsize);
...@@ -140,9 +143,7 @@ static void *Thread (void *data) ...@@ -140,9 +143,7 @@ static void *Thread (void *data)
break; break;
} }
} }
#ifdef HAVE_VMSPLICE vlc_cleanup_run (); /* free (buf) */
vlc_cleanup_run (); /* munmap (buf, bufsize) */
#endif
} }
while (!error); while (!error);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment