Skip to content

Commit

Permalink
Merge pull request ComputationalRadiationPhysics#68 from slizzered/fi…
Browse files Browse the repository at this point in the history
…x-coinstraints_checker_no_instance

The constraints check is no longer instantiated
  • Loading branch information
psychocoderHPC committed Jan 9, 2015
2 parents 91f9462 + c8f2277 commit 346f3a4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
17 changes: 9 additions & 8 deletions src/include/mallocMC/mallocMC_constraints.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,19 @@ namespace mallocMC{
/** The default PolicyCheckers (do always succeed)
*/
template<typename Policy1>
struct PolicyCheck1{};
class PolicyCheck1{};

template<typename Policy1, typename Policy2>
struct PolicyCheck2{};
class PolicyCheck2{};

template<typename Policy1, typename Policy2, typename Policy3>
struct PolicyCheck3{};
class PolicyCheck3{};

template<typename Policy1, typename Policy2, typename Policy3, typename Policy4>
struct PolicyCheck4{};
class PolicyCheck4{};

template<typename Policy1, typename Policy2, typename Policy3, typename Policy4, typename Policy5>
struct PolicyCheck5{};
class PolicyCheck5{};


/** Enforces constraints on policies or combinations of polices
Expand All @@ -63,8 +63,9 @@ namespace mallocMC{
typename T_GetHeapPolicy,
typename T_AlignmentPolicy
>
class PolicyConstraints{
PolicyCheck2<T_CreationPolicy, T_DistributionPolicy> c;

class PolicyConstraints:PolicyCheck2<T_CreationPolicy, T_DistributionPolicy>{

};


Expand All @@ -75,7 +76,7 @@ namespace mallocMC{
* the same value for their "pagesize"-parameter.
*/
template<typename x, typename y, typename z >
struct PolicyCheck2<
class PolicyCheck2<
typename CreationPolicies::Scatter<x,y>,
typename DistributionPolicies::XMallocSIMD<z>
>{
Expand Down
7 changes: 2 additions & 5 deletions src/include/mallocMC/mallocMC_hostclass.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ namespace mallocMC{
public T_CreationPolicy,
public T_OOMPolicy,
public T_ReservePoolPolicy,
public T_AlignmentPolicy
public T_AlignmentPolicy,
public PolicyConstraints<T_CreationPolicy,T_DistributionPolicy,T_OOMPolicy,T_ReservePoolPolicy,T_AlignmentPolicy>
{
public:
typedef T_CreationPolicy CreationPolicy;
Expand All @@ -96,10 +97,6 @@ namespace mallocMC{
typedef boost::uint32_t uint32;
void* pool;

//Instantiating the constraints checker will execute the check
PolicyConstraints<CreationPolicy,DistributionPolicy,
OOMPolicy,ReservePoolPolicy,AlignmentPolicy> c;

public:

typedef Allocator<CreationPolicy,DistributionPolicy,
Expand Down

0 comments on commit 346f3a4

Please sign in to comment.