compiled function For 2D array can be written as
cf2 = Compile[{{size, Integer}, {s, Integer}},
Block[{m}, m = Table[Table[0, {s}], {size}]],
RuntimeAttributes -> {Listable}, Parallelization -> True]
For example,
cf2[{1, 2, 3, 4}, {4, 5, 6, 2}]=
{{{0, 0, 0, 0}}, {{0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}}, {{0, 0, 0, 0, 0,
0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}}, {{0, 0}, {0, 0}, {0,
0}, {0, 0}}}