Skip to content

Commit

Permalink
Merge branch 'master' into autobuild/alpha_v380
Browse files Browse the repository at this point in the history
  • Loading branch information
c-lipka committed Sep 19, 2018
2 parents 4e885f7 + 425aa48 commit b382441
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
2 changes: 1 addition & 1 deletion source/base/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
/// where `N` is a serial number starting at 1 in each phase, `TIME` is the number of minutes
/// since 2000-01-01 00:00, and `FEATURE` is an arbitrary alphanumeric moniker for a particular
/// experimental feature.
#define POV_RAY_PRERELEASE "alpha.9841009"
#define POV_RAY_PRERELEASE "alpha.9844485"

#if defined(DOXYGEN) && !defined(POV_RAY_PRERELEASE)
// Work around doxygen being unable to document undefined macros.
Expand Down
2 changes: 1 addition & 1 deletion source/core/math/randomsequence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ Vector2d Uniform2dOnSquare(SequentialDoubleGeneratorPtr source)
{
double x = (*source)();
double y = (*source)();
return Vector2d((*source)(), (*source)());
return Vector2d(x, y);
}

Vector2d Uniform2dOnDisc(SequentialDoubleGeneratorPtr source)
Expand Down
23 changes: 23 additions & 0 deletions source/core/support/simplevector.h
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,23 @@ class VectorPool
{
if (initialPoolSize != 0)
mPool.reserve(initialPoolSize);
#ifdef POV_CORE_DEBUG
mAllocCount = 0;
#endif
}

~VectorPool()
{
for (auto&& p : mPool)
{
delete p;
#ifdef POV_CORE_DEBUG
--mAllocCount;
#endif
}
#ifdef POV_CORE_DEBUG
POV_CORE_ASSERT(mAllocCount == 0);
#endif
}

VectorPool(const VectorPool&) = delete;
Expand All @@ -638,6 +655,9 @@ class VectorPool
if (mPool.empty())
{
p = new VECTOR_T();
#ifdef POV_CORE_DEBUG
++mAllocCount;
#endif
}
else
{
Expand All @@ -660,6 +680,9 @@ class VectorPool

vector<VECTOR_T*> mPool;
size_t mSizeHint;
#ifdef POV_CORE_DEBUG
size_t mAllocCount;
#endif
};

//******************************************************************************
Expand Down

0 comments on commit b382441

Please sign in to comment.