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

Commit

Permalink
[ENGINE] Change obj pool to normal struct instead of union, to suppor…
Browse files Browse the repository at this point in the history
…t more compiler
  • Loading branch information
tqchen committed Sep 26, 2015
1 parent 6f7873a commit a610def
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion include/mxnet/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
* Used to support g++-4.6 and g++4.7
*/
#if DMLC_USE_CXX11 && defined(__GNUC__) && !defined(__clang_version__)
#if __GNUC__ == 4 && __GNUC_MINOR__ == 6
#if __GNUC__ == 4 && __GNUC_MINOR__ < 8
#error "Currently we need g++ 4.8 or higher to fully support c++11 features"
#define override
#define final
#endif
Expand Down
7 changes: 6 additions & 1 deletion src/common/object_pool.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,15 @@ class ObjectPool {
* \brief Internal structure to hold pointers.
*/
struct LinkedList {
#defined(_MSC_VER))
T t;
LinkedList* next{nullptr};
#else
union {
LinkedList* next{nullptr};
T t;
LinkedList* next{nullptr};
};
#endif
};
/*!
* \brief Page size of allocation.
Expand Down

0 comments on commit a610def

Please sign in to comment.