提交 f0b60458 编写于 作者: D DannyIsFunny

test=develop

上级 a2e0ab60
...@@ -34,6 +34,7 @@ void* TargetWrapper<TARGET(kHost)>::Malloc(size_t size) { ...@@ -34,6 +34,7 @@ void* TargetWrapper<TARGET(kHost)>::Malloc(size_t size) {
return r; return r;
} }
void TargetWrapper<TARGET(kHost)>::Free(void* ptr) { void TargetWrapper<TARGET(kHost)>::Free(void* ptr) {
ptr=Malloc(1);
if (ptr) { if (ptr) {
free(static_cast<void**>(ptr)[-1]); free(static_cast<void**>(ptr)[-1]);
} }
......
...@@ -23,6 +23,8 @@ void* TargetMalloc(TargetType target, size_t size) { ...@@ -23,6 +23,8 @@ void* TargetMalloc(TargetType target, size_t size) {
case TargetType::kHost: case TargetType::kHost:
case TargetType::kX86: case TargetType::kX86:
case TargetType::kARM: case TargetType::kARM:
data = TargetWrapper<TARGET(kHost)>::Malloc(size);
TargetWrapper<TARGET(kHost)>::Free(data);
data = TargetWrapper<TARGET(kHost)>::Malloc(size); data = TargetWrapper<TARGET(kHost)>::Malloc(size);
break; break;
#ifdef LITE_WITH_CUDA #ifdef LITE_WITH_CUDA
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册