Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Intel 文档只描述了传入的 ptr 应该指向从 ippsMalloc 分配的空间。如果我们在其中传递一个空指针,它并没有说明发生了什么。
void ippsFree(void* ptr);
ptr 指向要释放的内存块的指针。ptr 指向的内存块由函数 ippsMalloc 分配。
像免费/删除接受空指针一样安全吗?还是未定义?
查看 ippsFree 函数的反汇编,这些函数在输入时测试参数(指针)。使用 NULL 指针是安全的。