.. _slice_init: slice_init ========== .. code-block:: bl slice_init :: fn (_v: Any, n: s64, loc: ) Allocate heap memory for `n` elements in `_v` slice. Allocated block is set to zero default value. Allocated memory must be released by :ref:`slice_terminate` call. This way of memory allocation cause some overhead compared to plain `alloc` due to conversion to `Any` and more 'generic' behaviour, also setting to 0 have some runtime cost. Consider use of :ref:`alloc` instead in performance-critical cases. Example ------- .. literalinclude:: /examples/docs/008.bl :language: bl *Declared in: memory.bl*