finish libffi implementation