Skip to content

Instantly share code, notes, and snippets.

View wjwwood's full-sized avatar
🙃

William Woodall wjwwood

🙃
View GitHub Profile
@wjwwood
wjwwood / output.txt
Created July 28, 2011 04:18
Blender time example
Blender Game Engine Started
1th iteration with time period 0.03333333333333333
2th iteration with time period 0.06666666666666667
3th iteration with time period 0.1
4th iteration with time period 0.13333333333333333
5th iteration with time period 0.16666666666666666
6th iteration with time period 0.2
7th iteration with time period 0.23333333333333334
8th iteration with time period 0.26666666666666666
9th iteration with time period 0.3
@nhatminhle
nhatminhle / stdatomic.h
Last active August 11, 2024 21:57
A portable version of stdatomic.h extracted from the FreeBSD libc, for Clang 3.1+ and GCC 4.7+.
/*
* An implementation of C11 stdatomic.h directly borrowed from FreeBSD
* (original copyright follows), with minor modifications for
* portability to other systems. Works for recent Clang (that
* implement the feature c_atomic) and GCC 4.7+; includes
* compatibility for GCC below 4.7 but I wouldn't recommend it.
*
* Caveats and limitations:
* - Only the ``_Atomic parentheses'' notation is implemented, while
* the ``_Atomic space'' one is not.
@swarminglogic
swarminglogic / SmartObjectPool.h
Last active June 26, 2022 14:18
SmartObjectPool: A RAII-style implementation of the object pool pattern that uses smart pointers to automatically return acquired objects to the pool when deleted.
#include <memory>
#include <stack>
#include <stdexcept>
template <class T, class D = std::default_delete<T>>
class SmartObjectPool
{
private:
struct ReturnToPool_Deleter {
explicit ReturnToPool_Deleter(std::weak_ptr<SmartObjectPool<T, D>* > pool)