@BALLOC — Allocates a new binary buffer.

Syntax:
%@BALLOC[size]

sizethe size of the new buffer; required

@BALLOC returns a handle to the new buffer, which you will use in subsequent buffer operations.


This plugin replaces TCC’s internal @BALLOC function to add two new features:

  • The handle it returns will be remembered for later use. You can use BBLIST to list all currently allocated binary buffers, and @BFREEALL to free them all at once.

  • The size may optionally be followed by a letter to indicate scale. Note that case is significant:

kthousands of bytes
Kkilobytes (1,024 bytes)
mmillions of bytes
Mmegabytes (1,048,576 bytes)
gbillions of bytes
Ggigabytes (1,073,741,824 bytes)

rem   Allocate a 5-kilobyte buffer:
set bbuf=%@balloc[5K]

See also: @BFREE, @BFREEALL.