Be concise.
Be useful.
All contributions dictatorially edited by webmasters to match personal tastes.
Please do not paste any copyright violating material.
Please try to avoid dependencies to third-party libraries and frameworks.
type Byte is range 0 .. 255
with Size => 8;
type Byte_Array is array (Positive range <>) of Byte;
Buf : Byte_Array (1 .. 1_000_000);
vector<byte> _buf(1'000'000);
var buf = new byte[1000000];
buf := make([]byte, 1_000_000)
let buf = new Buffer (1e6)
byte[] buf = new byte[1000000];
byte buf[] = new byte[1_000_000];
byte buf[] = new byte[(int) 1e6];
$memStart = memory_get_usage();
$buf = str_repeat("\x00", 1000 * 1000);
$memEnd = memory_get_usage();
echo $memEnd - $memStart, PHP_EOL;
var
buf: Pointer;
begin
buf := GetMem(1000000);
end;
my $buf = ' ' * 1_000_000;
buf = bytearray(1000000)
buf = (' ' * 1_000_000).bytes
let buf: Vec<u8> = Vec::with_capacity(1000000);