From d2504ead2f7eb02b6a33545de2cf1b5957306fd6 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Sat, 21 Jun 2014 18:06:07 +0200 Subject: clover: Have compat::string allocate its own memory. --- src/gallium/state_trackers/clover/api/kernel.cpp | 4 +++- src/gallium/state_trackers/clover/util/compat.hpp | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'src/gallium') diff --git a/src/gallium/state_trackers/clover/api/kernel.cpp b/src/gallium/state_trackers/clover/api/kernel.cpp index 96cf302b161..05cc392a914 100644 --- a/src/gallium/state_trackers/clover/api/kernel.cpp +++ b/src/gallium/state_trackers/clover/api/kernel.cpp @@ -58,7 +58,9 @@ clCreateKernelsInProgram(cl_program d_prog, cl_uint count, if (rd_kerns) copy(map([&](const module::symbol &sym) { - return desc(new kernel(prog, compat::string(sym.name), + return desc(new kernel(prog, + std::string(sym.name.begin(), + sym.name.end()), range(sym.args))); }, syms), rd_kerns); diff --git a/src/gallium/state_trackers/clover/util/compat.hpp b/src/gallium/state_trackers/clover/util/compat.hpp index e68d9df2969..28601e878e8 100644 --- a/src/gallium/state_trackers/clover/util/compat.hpp +++ b/src/gallium/state_trackers/clover/util/compat.hpp @@ -72,7 +72,7 @@ namespace clover { vector(const vector &v) : p(alloc(v.n, v.p, v.n)), n(v.n) { } - vector(iterator p, size_type n) : p(alloc(n, p, n)), n(n) { + vector(const_iterator p, size_type n) : p(alloc(n, p, n)), n(n) { } template @@ -263,13 +263,13 @@ namespace clover { size_t offset; }; - class string : public vector_ref { + class string : public vector { public: - string(const char *p) : vector_ref(p, std::strlen(p)) { + string(const char *p) : vector(p, std::strlen(p)) { } template - string(const C &v) : vector_ref(v) { + string(const C &v) : vector(v) { } operator std::string() const { -- cgit v1.2.3