Commit Graph

20 Commits (96e445d9e43e7d4a4cb32a1681098a6e7a170561)

Author SHA1 Message Date
Rob Davies 96e445d9e4 Reduce dependency on utils.h - new malloc wrapping scheme.
Remove xmalloc, xcalloc, xrealloc and xstrdup from utils.h and revert calls
to the normal malloc, calloc, realloc, strdup.  Add new files malloc_wrap.[ch]
with the wrapper functions.  malloc_wrap.h #defines malloc etc. to the
wrapper, but only if USE_MALLOC_WRAPPERS has been defined.

Put #include "malloc_wrap.h" in any file that uses *alloc or strdup.  This
is also in a #ifdef USE_MALLOC_WRAPPERS ... #endif block to make using the
wrappers optional.  Add -DUSE_MALLOC_WRAPPERS into the makefile so they
should normally get added.

This is an improvement on the previous method as we now don't need to
worry about stray function calls that were not changed to the wrapped version
and the code will still work even if the wrapping is disabled.

Other possible methods of doing this are using malloc_hook (glibc-specific),
adding -include malloc_wrap.h to the gcc command-line (somewhat
gcc-specific) or making our own malloc function and using dlopen (scary).
This way is probably the most portable.
2013-05-02 15:12:01 +01:00
Rob Davies 4cb5110d03 Merge branch 'master' into master_fixes 2013-04-22 09:51:07 +01:00
Heng Li f6ae0d4d0f r382: similar treatment in bwa-sw (see r381) 2013-04-19 17:52:06 -04:00
Rob Davies 8a078cc16d Merge branch 'master' into master_fixes
Conflicts:
	bntseq.c
	bwamem.c
2013-03-05 10:21:07 +00:00
Heng Li 1a451df800 prepare to ditch stdaln.{h,c} 2013-03-04 10:32:33 -05:00
Rob Davies 3d33ab063e Merge branch 'master' into master_fixes
Merged to master version b621d3a

Conflicts:
	Makefile
	bntseq.c
	bwa.c
	bwase.c
	bwaseqio.c
	bwtaln.c
	bwtindex.c
	bwtio.c
	bwtmisc.c
	bwtsw2_aux.c
	cs2nt.c
	fastmap.c
	khash.h
	kseq.h
	ksw.c
	kvec.h
	simple_dp.c
	utils.c
	utils.h
2013-03-01 09:37:46 +00:00
Heng Li 557daabf38 bugfix: bug in the new ksw.c
On my test data, one alignment is different, caused by polyA
2013-02-12 17:48:46 -05:00
Heng Li 28a7d501f2 updated to the latest ksw; NOT TESTED YET!!! 2013-02-12 16:35:05 -05:00
Heng Li e5ab59db53 Multiple changes:
1. Removed bwa.{h,c}. I am not going to finish them anyway.
2. Updated to the latest khash.h, which should be faster.
3. Define 64-bit vector and 128-bit integer/vector in utils.h.
2013-02-12 09:50:28 -05:00
Heng Li 4431e359e2 analyze isize distribution 2013-02-11 12:15:12 -05:00
Rob Davies b081ac9b8b Use wrapper functions to catch system errors
Use the wrapper functions in utils.c plus a few extra bits of error
checking code to catch system errors and exit non-zero when they occur.
2012-12-16 10:34:57 +00:00
Heng Li cd818687ac r115: added -I and -S to bwasw 2012-04-17 20:43:43 -04:00
Heng Li 64e353ce49 bugfix: bwa-sw PE segfault in rare case 2011-11-28 09:12:21 -05:00
Heng Li 182cb2e89c use standard SW when no SSE2 2011-11-19 19:38:21 -05:00
Heng Li 8060693411 multithreading works again 2011-11-12 16:50:58 -05:00
Heng Li fa8cfe5567 bugfix: wrong mapping quality 2011-11-12 12:12:45 -05:00
Heng Li b42910ada6 proper mate information 2011-11-12 00:49:21 -05:00
Heng Li e06685db45 bwa-sw PE seems working (SAM is incorrect) 2011-11-07 00:51:43 -05:00
Heng Li c8c79ef024 mate rescue seems working (not MT) 2011-11-06 16:20:40 -05:00
Heng Li 17eaac5a21 compute insert size distribution 2011-11-05 23:17:52 -04:00