mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Add temp allocator scribble. Make bufferstream safer.
This commit is contained in:
@@ -141,15 +141,9 @@ fn usz! copy_to(InStream in, OutStream dst, char[] buffer = {})
|
||||
if (&dst.read_to) return dst.read_to(in);
|
||||
$switch (env::MEMORY_ENV)
|
||||
$case NORMAL:
|
||||
@pool()
|
||||
{
|
||||
return copy_through_buffer(in, dst, mem::temp_alloc_array(char, 4096));
|
||||
};
|
||||
return copy_through_buffer(in, dst, &&char[4096]{});
|
||||
$case SMALL:
|
||||
@pool()
|
||||
{
|
||||
return copy_through_buffer(in, dst, mem::temp_alloc_array(char, 1024));
|
||||
};
|
||||
return copy_through_buffer(in, dst, &&char[1024]{});
|
||||
$case TINY:
|
||||
$case NONE:
|
||||
return copy_through_buffer(in, dst, &&(char[256]{}));
|
||||
|
||||
Reference in New Issue
Block a user