-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modify the repo to work with Travis CI (#1)
* Modified tree to use C++17 to fight STL allocator errors * Fixed syntax * Removed semicolon warning because old habits die hard * Removed pie and modules * Forgot that cotire requires it to be set at the target level * Forced to add rebind it seems like * Gotta learn to build locally * Debug attempt: checking the std version * Wow I can't see the glaring 14 right in front of me * Fine, I'll fix the bloody allocator for C++14 since 17 isn't ready yet. * Fixed doxygen comments * Implement the rest of the dumb STLAllocator * Forced to disable the gold plugin. Sad day indeed. * Removed the intentional failure on calls to unimplemented functions
- Loading branch information
Showing
8 changed files
with
55 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then | ||
cmake . -DCMAKE_BUILD_TYPE=Release -DCOTIRE_MINIMUM_NUMBER_OF_TARGET_SOURCES=1 | ||
cmake . -DCMAKE_BUILD_TYPE=Release -DCOTIRE_MINIMUM_NUMBER_OF_TARGET_SOURCES=1 -DGOLD_PLUGIN=OFF | ||
else | ||
cmake . -DCMAKE_BUILD_TYPE=Debug -DCOTIRE_MINIMUM_NUMBER_OF_TARGET_SOURCES=1 | ||
cmake . -DCMAKE_BUILD_TYPE=Debug -DCOTIRE_MINIMUM_NUMBER_OF_TARGET_SOURCES=1 -DGOLD_PLUGIN=OFF | ||
fi | ||
make | ||
ctest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,44 @@ | ||
#pragma once | ||
|
||
template <class AType> AType* CYB::API::Interop::STLAllocator<AType>::allocate(const std::size_t ACount) { | ||
template <typename AType> auto CYB::API::Interop::STLAllocator<AType>::address(reference AObject) noexcept -> pointer { | ||
return std::addressof<AType>(AObject); | ||
} | ||
|
||
template <typename AType> auto CYB::API::Interop::STLAllocator<AType>::address(const_reference AObject) noexcept -> const_pointer { | ||
return std::addressof<AType>(AObject); | ||
} | ||
|
||
template <typename AType> AType* CYB::API::Interop::STLAllocator<AType>::allocate(const std::size_t ACount) { | ||
const auto Size(sizeof(AType) * ACount); | ||
Assert::LessThanOrEqual<unsigned long long>(Size, static_cast<unsigned long long>(std::numeric_limits<int>::max())); | ||
return static_cast<AType*>(Context::GetContext().FAllocator.FHeap.Alloc(static_cast<int>(Size))); | ||
} | ||
|
||
template <class AType> void CYB::API::Interop::STLAllocator<AType>::deallocate(AType* const AObject, const std::size_t ACount) noexcept { | ||
template <typename AType> void CYB::API::Interop::STLAllocator<AType>::deallocate(AType* const AObject, const std::size_t ACount) noexcept { | ||
const auto Size(sizeof(AType) * ACount); | ||
Assert::LessThanOrEqual<unsigned long long>(Size, static_cast<unsigned long long>(std::numeric_limits<int>::max())); | ||
Context::GetContext().FAllocator.FHeap.Free(AObject); | ||
} | ||
|
||
template <class AType> template <class AOtherType> CYB::API::Interop::STLAllocator<AType>::STLAllocator(const AOtherType& AOther) noexcept { | ||
template <typename AType> template <typename AOther, typename... AArgs> void CYB::API::Interop::STLAllocator<AType>::construct(AOther* const APointer, AArgs&&... AArguments) { | ||
::new (static_cast<void*>(APointer)) AOther(std::forward<AArgs>(AArguments)...); | ||
} | ||
|
||
template <typename AType> template <typename AOther> void CYB::API::Interop::STLAllocator<AType>::destroy(AOther* const APointer) noexcept { | ||
static_cast<void>(APointer); //MSVC thinks calling the destructor counts as having the pointer being unreferenced | ||
APointer->~AOther(); | ||
} | ||
|
||
template <typename AType> template <typename AOtherType> CYB::API::Interop::STLAllocator<AType>::STLAllocator(const AOtherType& AOther) noexcept { | ||
static_cast<void>(AOther); | ||
} | ||
|
||
template <class AType> template<class ARType> constexpr bool CYB::API::Interop::STLAllocator<AType>::operator==(const STLAllocator<ARType>& ARHS) const noexcept { | ||
template <typename AType> template<typename ARType> constexpr bool CYB::API::Interop::STLAllocator<AType>::operator==(const STLAllocator<ARType>& ARHS) const noexcept { | ||
static_cast<void>(ARHS); | ||
return true; | ||
} | ||
|
||
template <class AType> template<class ARType> constexpr bool CYB::API::Interop::STLAllocator<AType>::operator!=(const STLAllocator<ARType>& ARHS) const noexcept { | ||
template <typename AType> template<typename ARType> constexpr bool CYB::API::Interop::STLAllocator<AType>::operator!=(const STLAllocator<ARType>& ARHS) const noexcept { | ||
static_cast<void>(ARHS); | ||
return false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters