Changeset 481 for trunk/src/dnmalloc.c


Ignore:
Timestamp:
Jul 18, 2015, 5:06:52 PM (6 years ago)
Author:
katerina
Message:

Enhancements and fixes for tickets #374, #375, #376, #377, #378, and #379.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/dnmalloc.c

    r383 r481  
    220220#ifdef linux
    221221#define HAVE_MREMAP 1
    222 #define _GNU_SOURCE
     222#define _GNU_SOURCE 1
    223223#else
    224224#define HAVE_MREMAP 0
     
    310310  char * i3 = "): ";
    311311  char * i5 = "\n";
    312   int   res = 0;
    313 
    314   iov[0].iov_base = i1;               iov[0].iov_len = strlen(i1);
    315   iov[1].iov_base = (char*) file;     iov[1].iov_len = strlen(file);
    316   iov[2].iov_base = i3;               iov[2].iov_len = strlen(i3);
    317   iov[3].iov_base = (char*) error;    iov[3].iov_len = strlen(error);
    318   iov[4].iov_base = i5;               iov[4].iov_len = strlen(i5);
     312  int    res = 0;
     313  char   ifile[128];
     314  char   ierr[128];
     315
     316  strncpy(ifile, file, sizeof(ifile)); ifile[sizeof(ifile)-1] = '\0';
     317  strncpy(ierr, error, sizeof(ierr));  ierr[sizeof(ierr)-1]   = '\0';
     318
     319  iov[0].iov_base = i1;     iov[0].iov_len = strlen(i1);
     320  iov[1].iov_base = ifile;  iov[1].iov_len = strlen(ifile);
     321  iov[2].iov_base = i3;     iov[2].iov_len = strlen(i3);
     322  iov[3].iov_base = ierr;   iov[3].iov_len = strlen(ierr);
     323  iov[4].iov_base = i5;     iov[4].iov_len = strlen(i5);
    319324  do {
    320325    res = writev(STDERR_FILENO, iov, 5);
     
    343348
    344349static assert_handler_tp *assert_handler = NULL;
     350#ifndef NDEBUG
    345351#define NDEBUG
     352#endif
    346353#define assert(x) ((void)0)
    347354
     
    37643771    } /* not extended previous region */
    37653772   
    3766     /* Update statistics */ /* FIXME check this */
     3773    /* Update statistics */
    37673774    sum = av->sbrked_mem;
    37683775    if (sum > (CHUNK_SIZE_T)(av->max_sbrked_mem))
Note: See TracChangeset for help on using the changeset viewer.