converted some global_alloc_array() usage to dynamic_array/dynamic_buffer (nw)