There is one interesting function: erts_create_magic_binary(size, destructor), but now it is required to make the same one, that doesn't allocate binary data.