1.02b - Workaround for *BSD systems with malloc J or Z options set by default.

This commit is contained in:
Steve Pinkham 2010-03-20 11:49:23 -04:00
parent a73baf0449
commit d4e2d34e0b
4 changed files with 27 additions and 1 deletions

15
ChangeLog Normal file
View File

@ -0,0 +1,15 @@
Version 1.02b:
--------------
- Workaround for *BSD systems with malloc J or Z options set
by default.
Version 1.01b:
--------------
- Workaround for a glitch in glibc "fortify".
Version 1.00b:
--------------
- Initial public release.

View File

@ -28,11 +28,13 @@
#include <stdlib.h>
#ifndef __FreeBSD__
#ifdef __APPLE__
#include <malloc/malloc.h>
#else
#include <malloc.h>
#endif /* __APPLE__ */
#endif /* !__FreeBSD__ */
#include <string.h>
@ -119,6 +121,7 @@ static inline void* __DFL_ck_strdup(u8* str) {
return ret;
}
static inline void* __DFL_ck_memdup(u8* mem, u32 size) {
void* ret;
u32 usable;
@ -247,6 +250,7 @@ static inline void* __AD_ck_alloc(u32 size, const char* file, const char* func,
return ret;
}
static inline void* __AD_ck_realloc(void* orig, u32 size, const char* file,
const char* func, u32 line) {
void* ret = __DFL_ck_realloc(orig, size);
@ -255,6 +259,7 @@ static inline void* __AD_ck_realloc(void* orig, u32 size, const char* file,
return ret;
}
static inline void* __AD_ck_strdup(u8* str, const char* file, const char* func,
u32 line) {
void* ret = __DFL_ck_strdup(str);
@ -262,6 +267,7 @@ static inline void* __AD_ck_strdup(u8* str, const char* file, const char* func,
return ret;
}
static inline void* __AD_ck_memdup(u8* mem, u32 size, const char* file,
const char* func, u32 line) {
void* ret = __DFL_ck_memdup(mem, size);
@ -269,6 +275,7 @@ static inline void* __AD_ck_memdup(u8* mem, u32 size, const char* file,
return ret;
}
static inline void __AD_ck_free(void* ptr, const char* file,
const char* func, u32 line) {
__AD_free_buf(ptr, file, func, line);

View File

@ -23,7 +23,7 @@
#ifndef _HAVE_CONFIG_H
#define _HAVE_CONFIG_H
#define VERSION "1.01b"
#define VERSION "1.02b"
#define USE_COLOR 1 /* Use terminal colors */

View File

@ -48,6 +48,10 @@ u32 __AD_trk_cnt[ALLOC_BUCKETS];
#endif /* DEBUG_ALLOCATOR */
/* *BSD where J or Z is set are incompatible with our allocator. */
char* _malloc_options = "jz";
void usage(char* argv0) {
SAY("Usage: %s [ options ... ] -o output_dir start_url [ start_url2 ... ]\n\n"