Ignore:
Timestamp:
Dec 28, 2016, 7:21:28 PM (2 years ago)
Author:
nmedfort
Message:

Cleaned up memory leaks + some warning messages.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/base64.cpp

    r5238 r5240  
    2929#include <kernels/radix64.h>
    3030#include <kernels/stdout_kernel.h>
    31 #include <llvm/IR/TypeBuilder.h>
    3231
    3332
     
    8382    Type * const int32ty = iBuilder->getInt32Ty();
    8483    Type * const int8PtrTy = iBuilder->getInt8PtrTy();
    85     Type * const voidPtrTy = TypeBuilder<void *, false>::get(mMod->getContext());
     84    Type * const voidPtrTy = iBuilder->getVoidPtrTy();
    8685
    8786   
     
    168167    size_t mFileSize;
    169168    char * mFileBuffer;
    170    
     169
    171170    const boost::filesystem::path file(mFileName);
    172171    if (exists(file)) {
     
    203202    else if (memAlignBuffering) {
    204203        char * outputBuffer;
    205         posix_memalign(reinterpret_cast<void **>(&outputBuffer), 32, 2*mFileSize);
     204        if (posix_memalign(reinterpret_cast<void **>(&outputBuffer), 32, 2*mFileSize)) {
     205            throw std::bad_alloc();
     206        }
    206207        fn_ptr(mFileBuffer, outputBuffer, mFileSize);
    207208        free(reinterpret_cast<void *>(outputBuffer));
Note: See TracChangeset for help on using the changeset viewer.