new function mem_get, bugfix in ptr_type