Patch eco_malloc functions to allow more than 4Gb allocation on 64bits version

git-svn-id: https://www.grenoble.prabi.fr/svn/LECASofts/ecoPrimers/trunk@206 60f365c0-8329-0410-b2a4-ec073aeeaa1d
This commit is contained in:
2009-04-28 08:19:50 +00:00
parent 796274d746
commit c308fb2edc
3 changed files with 8 additions and 6 deletions

View File

@ -20,7 +20,7 @@ void ecoMallocedMemory()
return eco_amount_malloc; return eco_amount_malloc;
} }
void *eco_malloc(int32_t chunksize, void *eco_malloc(int64_t chunksize,
const char *error_message, const char *error_message,
const char *filename, const char *filename,
int32_t line) int32_t line)
@ -47,7 +47,7 @@ void *eco_malloc(int32_t chunksize,
} }
void *eco_realloc(void *chunk, void *eco_realloc(void *chunk,
int32_t newsize, int64_t newsize,
const char *error_message, const char *error_message,
const char *filename, const char *filename,
int32_t line) int32_t line)
@ -58,8 +58,10 @@ void *eco_realloc(void *chunk,
if (!newchunk) if (!newchunk)
{
ecoError(ECO_MEM_ERROR,error_message,filename,line); ecoError(ECO_MEM_ERROR,error_message,filename,line);
fprintf('Requested memory : %d\n',newsize);
}
if (!chunk) if (!chunk)
eco_chunk_malloc++; eco_chunk_malloc++;

View File

@ -130,14 +130,14 @@ typedef struct {
int32_t is_big_endian(); int32_t is_big_endian();
int32_t swap_int32_t(int32_t); int32_t swap_int32_t(int32_t);
void *eco_malloc(int32_t chunksize, void *eco_malloc(int64_t chunksize,
const char *error_message, const char *error_message,
const char *filename, const char *filename,
int32_t line); int32_t line);
void *eco_realloc(void *chunk, void *eco_realloc(void *chunk,
int32_t chunksize, int64_t chunksize,
const char *error_message, const char *error_message,
const char *filename, const char *filename,
int32_t line); int32_t line);

View File

@ -50,7 +50,7 @@ void addSeqToWordCountTable(pwordcount_t table, uint32_t wordsize, uint32_t circ
buffersize = table->size + ecoWordCount(wordsize,circular,seq); buffersize = table->size + ecoWordCount(wordsize,circular,seq);
table->words = ECOREALLOC(table->words,buffersize*sizeof(word_t), table->words = ECOREALLOC(table->words,buffersize*sizeof(word_t),
"Cannot allocate memory to extend word table"); "\n\nCannot allocate memory to extend word table" );
newtable = table->words + table->size; newtable = table->words + table->size;