Browse Source

clover: Have compat::string allocate its own memory.

tags/10.3-branchpoint
Francisco Jerez 11 years ago
parent
commit
d2504ead2f

+ 3
- 1
src/gallium/state_trackers/clover/api/kernel.cpp View File

@@ -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);

+ 4
- 4
src/gallium/state_trackers/clover/util/compat.hpp View File

@@ -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<typename C>
@@ -263,13 +263,13 @@ namespace clover {
size_t offset;
};

class string : public vector_ref<const char> {
class string : public vector<char> {
public:
string(const char *p) : vector_ref(p, std::strlen(p)) {
string(const char *p) : vector(p, std::strlen(p)) {
}

template<typename C>
string(const C &v) : vector_ref(v) {
string(const C &v) : vector(v) {
}

operator std::string() const {

Loading…
Cancel
Save