Changeset 31 for tags


Ignore:
Timestamp:
Feb 8, 2008, 8:29:55 AM (11 years ago)
Author:
cameron
Message:

Eliminate malloc in favor of new

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tags/parabix-0.39/src/xmlbuffer.c

    r15 r31  
    2222     plus additional space up to the next block boundary. */
    2323  alloc_size = fileinfo.st_size + pad_bytes;
    24   ByteBuffer = (unsigned char *) malloc(alloc_size);
    25   if (ByteBuffer == NULL) {
    26       fprintf(stderr, "Error: buffer for %s of size %i cannot be created.\n",
    27               filename, alloc_size);
    28       exit(-1);
    29   }
     24  ByteBuffer = new unsigned char [alloc_size];
    3025  FILE *infile;
    3126  infile = fopen(filename, "rb");
Note: See TracChangeset for help on using the changeset viewer.