enforce memory bounds