Optimize memory usage of TextPool

Verify that  `offset + length < textPoolSize`