Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use unsigned integers for malloc arguments to allow mallocation of more than 2Gb...
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 24 Jan 2008 18:47:00 +0000 (18:47 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 24 Jan 2008 18:47:00 +0000 (18:47 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@5233 48e7efb5-ca39-0410-a469-dd3cf9ba447f

include/xbt/sysdep.h

index 8faa0da..96613ca 100644 (file)
@@ -56,7 +56,7 @@ static XBT_INLINE char *xbt_strdup(const char *s) {
 }
 /** @brief Like malloc, but xbt_die() on error 
     @hideinitializer */
-static XBT_INLINE void *xbt_malloc(int n){
+static XBT_INLINE void *xbt_malloc(unsigned int n){
   void *res=malloc(n);
   if (!res)
      xbt_die(bprintf("Memory allocation of %d bytes failed",n));
@@ -65,7 +65,7 @@ static XBT_INLINE void *xbt_malloc(int n){
 
 /** @brief like malloc, but xbt_die() on error and memset data to 0
     @hideinitializer */
-static XBT_INLINE void *xbt_malloc0(int n) {
+static XBT_INLINE void *xbt_malloc0(unsigned int n) {
   void *res=calloc(n,1);
   if (!res)
      xbt_die(bprintf("Memory callocation of %d bytes failed",n));
@@ -74,7 +74,7 @@ static XBT_INLINE void *xbt_malloc0(int n) {
   
 /** @brief like realloc, but xbt_die() on error 
     @hideinitializer */
-static XBT_INLINE void *xbt_realloc(void*p,int s){
+static XBT_INLINE void *xbt_realloc(void*p,unsigned int s){
   void *res=res;
   if (s) {
     if (p) {