 +}
 +
 +static mt_bamcopy_t mt_bamcopy;
-+static mt_bamcopy_t * mt_bamcopy_init(mt_page_write_t *page_write, mt_hash_t *hash, bucket_array_t * bucket_array, bam_hdr_t *header, size_t _max_mem, int paging) { 
++static mt_bamcopy_t * mt_bamcopy_init(mt_page_write_t *page_write, mt_hash_t *hash, bucket_array_t * bucket_array, bam_hdr_t *header, int paging) { 
 +
 +  malloc_qnameid_space(n_bam_copier);
 +

+	REGISTER_MEM_ID(mem_getInstID18);
+	REGISTER_MEM_ID(mem_sortSam1);
+	REGISTER_MEM_ID(mem_sortSam2);
+}
+
+static long mem_id = 0; // 0 is not used to detect use of a static id variable (usually zero) before registration

+  pthread_attr_init(&attr);
+  mt_linesplit_t *linesplit = &mt_linesplit;
+  linesplit->samparse = samparse;
+  linesplit->bam_free_list2 = samparse->bam_free_list2;
+  linesplit->w = md_malloc(sizeof(linesplit->w[0])*n_line_splitter, mem_linesplitInit, 1);
+  linesplit->my_q = md_malloc(sizeof(linesplit->my_q[0])*n_block_reader, mem_linesplitInit, 1);
