[arrayfire] 73/284: toString now uses af_alloc_host to allocate memory
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Sun Feb 7 18:59:20 UTC 2016
This is an automated email from the git hooks/post-receive script.
ghisvail-guest pushed a commit to branch debian/experimental
in repository arrayfire.
commit f628fbe535163508328d18836b77c0db72275197
Author: Shehzan Mohammed <shehzan at arrayfire.com>
Date: Mon Dec 14 17:49:00 2015 -0500
toString now uses af_alloc_host to allocate memory
---
src/api/c/print.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/api/c/print.cpp b/src/api/c/print.cpp
index a5c178c..ea84cd6 100644
--- a/src/api/c/print.cpp
+++ b/src/api/c/print.cpp
@@ -172,8 +172,8 @@ af_err af_array_to_string(char **output, const char *exp, const af_array arr,
default: TYPE_ERROR(1, type);
}
std::string str = ss.str();
- *output = new char[str.size() + 1];
- std::copy(str.begin(), str.end(), *output);
+ af_alloc_host((void**)output, sizeof(char) * (str.size() + 1));
+ str.copy(*output, str.size());
(*output)[str.size()] = '\0'; // don't forget the terminating 0
}
CATCHALL;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/arrayfire.git
More information about the debian-science-commits
mailing list