Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Merge pull request #38 from thirdwing/master
Browse files Browse the repository at this point in the history
compile on Mac OSX
  • Loading branch information
antinucleon committed Sep 5, 2015
2 parents a5a54e2 + a83b6ac commit 3c769f1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/storage/cpu_device_storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,13 @@ class CPUDeviceStorage {
}; // class CPUDeviceStorage

inline void* CPUDeviceStorage::Alloc(size_t size) {
#ifdef __APPLE__
return CHECK_NOTNULL(malloc(size));
#elif _MSC_VER
return CHECK_NOTNULL(_aligned_malloc(size, alignment_));
#else
return CHECK_NOTNULL(memalign(alignment_, size));
#endif
}

inline void CPUDeviceStorage::Free(void* ptr) { free(ptr); }
Expand Down

0 comments on commit 3c769f1

Please sign in to comment.