Dynamic allocations need to be metered in polkavm but this will be implemented later on. As an interim solution, we just use a static buffer instead.
The exact size of this has still to be determined. The amount of memory a contract can consume on EVM is capped by the blocks gas limit, currently around a couple megabytes (see also this discussion). Using a static buffer implies a fixed a fixed cost, it is also connected to the maximum call stack depth we will allow. However, assuming we can do away with just a fraction of EVMs call stack depth limit of 1024, this penalty should be very small regardless.
If needed, the static buffer size it could also be set as a compiler option.
Dynamic allocations need to be metered in polkavm but this will be implemented later on. As an interim solution, we just use a static buffer instead.
The exact size of this has still to be determined. The amount of memory a contract can consume on EVM is capped by the blocks gas limit, currently around a couple megabytes (see also this discussion). Using a static buffer implies a fixed a fixed cost, it is also connected to the maximum call stack depth we will allow. However, assuming we can do away with just a fraction of EVMs call stack depth limit of 1024, this penalty should be very small regardless.
If needed, the static buffer size it could also be set as a compiler option.