Implementation: improved memory safety