increase initial allocation for locale array
change reallocation to simpler buffer guard
TODO: update
move layout struct to main header