Take this code which represents a matrix in C.

```
int** mat = (int**) malloc(rows * sizeof(int*))
for (int index=0;index<row;++index) {
mat[index] = (int*) malloc(cols * sizeof(int));
}
```

What is the best way to wrap `mat`

into a `Matrix{Float32}`

?

Right now, I came up with this solution:

```
result = Matrix{V}(undef, m, n)
rows = Base.unsafe_wrap(Vector{Ptr{V}}, mat, m)
@inbounds @simd for i in 1:length(rows)
result[i, :] = Base.unsafe_wrap(Vector{V}, rows[i], n)
end
return result
```

Any ideas on optimizing it?