 
     if (head.num_inst > 0) {
         char *code;
+        code = new char[sizeof(head) + sizeof(inst[0]) * head.num_inst];
+/*
         gpuErrchk(cudaMallocHost((void**)&code,
                                  sizeof(head) + sizeof(inst[0]) * head.num_inst));
-
+*/
         memcpy(code, &head, sizeof(head));
         memcpy(code + sizeof(head), inst, sizeof(inst[0]) * head.num_inst);
 


abpvm_query::abpvm_query()
{
    gpuErrchk(cudaMallocHost((void**)&m_uri, MAX_QUERY_LEN));
    gpuErrchk(cudaMallocHost((void**)&m_uri_lower, MAX_QUERY_LEN));
}

abpvm_query::~abpvm_query()
{
    gpuErrchk(cudaFreeHost(m_uri));
    gpuErrchk(cudaFreeHost(m_uri_lower));
}

void

{
    for (auto &p: m_codes) {
        gpuErrchk(cudaFree(p->d_code));
        //gpuErrchk(cudaFreeHost(p->code));
        delete[] p->code;
    }

    if (m_d_codes != nullptr) {
