From c308fb2edce8c371b0705aa95695052f015d6a44 Mon Sep 17 00:00:00 2001 From: Eric Coissac Date: Tue, 28 Apr 2009 08:19:50 +0000 Subject: [PATCH] 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 --- src/libecoPCR/ecoMalloc.c | 8 +++++--- src/libecoPCR/ecoPCR.h | 4 ++-- src/libecoprimer/strictprimers.c | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/libecoPCR/ecoMalloc.c b/src/libecoPCR/ecoMalloc.c index f1a0d0f..0719a8d 100644 --- a/src/libecoPCR/ecoMalloc.c +++ b/src/libecoPCR/ecoMalloc.c @@ -20,7 +20,7 @@ void ecoMallocedMemory() return eco_amount_malloc; } -void *eco_malloc(int32_t chunksize, +void *eco_malloc(int64_t chunksize, const char *error_message, const char *filename, int32_t line) @@ -47,7 +47,7 @@ void *eco_malloc(int32_t chunksize, } void *eco_realloc(void *chunk, - int32_t newsize, + int64_t newsize, const char *error_message, const char *filename, int32_t line) @@ -58,8 +58,10 @@ void *eco_realloc(void *chunk, if (!newchunk) + { ecoError(ECO_MEM_ERROR,error_message,filename,line); - + fprintf('Requested memory : %d\n',newsize); + } if (!chunk) eco_chunk_malloc++; diff --git a/src/libecoPCR/ecoPCR.h b/src/libecoPCR/ecoPCR.h index bd13942..237ec32 100644 --- a/src/libecoPCR/ecoPCR.h +++ b/src/libecoPCR/ecoPCR.h @@ -130,14 +130,14 @@ typedef struct { int32_t is_big_endian(); 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 *filename, int32_t line); void *eco_realloc(void *chunk, - int32_t chunksize, + int64_t chunksize, const char *error_message, const char *filename, int32_t line); diff --git a/src/libecoprimer/strictprimers.c b/src/libecoprimer/strictprimers.c index 175379a..868933c 100644 --- a/src/libecoprimer/strictprimers.c +++ b/src/libecoprimer/strictprimers.c @@ -50,7 +50,7 @@ void addSeqToWordCountTable(pwordcount_t table, uint32_t wordsize, uint32_t circ buffersize = table->size + ecoWordCount(wordsize,circular,seq); 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;