This file contains hidden or 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
| #include <inttypes.h> | |
| #include <math.h> | |
| #include <cstddef> | |
| #include <iostream> | |
| #define PRECISION (8) | |
| #define MAX_ITER (10) | |
| /*Storage for logarithm look-up table, will be in program memory | |
| of Harvard architecture MPU */ |
This file contains hidden or 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
| template <typename Derived> | |
| class CircularBufferCRTP { | |
| public: | |
| template <typename T> | |
| static Derived* create(size_t max_size) { | |
| return Derived::template create_<T>(max_size); | |
| } | |
| template <typename T> | |
| bool push(const T& in_data) { |
This file contains hidden or 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
| #ifndef STATEFULALLOCATOR_H | |
| #define STATEFULALLOCATOR_H | |
| #include <cstdint> | |
| #include <new> | |
| #include <memory> | |
| #include <array> | |
| #include <vector> | |
| #include "debug_msg.h" | |
| #include "uP_allocator.h" |
This file contains hidden or 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
| #ifndef SMART_PTR_H_INCLUDED | |
| #define SMART_PTR_H_INCLUDED | |
| #include <cstddef> | |
| #include "uP_allocator.h" | |
| namespace SmartPtr { | |
| using namespace uP_allocator; |
This file contains hidden or 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
| #ifndef ABSTRACTPRNG_H | |
| #define ABSTRACTPRNG_H | |
| #include <stdint.h> | |
| #include <vector> | |
| #include <algorithm> | |
| #include <avr/wdt.h> | |
| #include "uP_allocator.h" | |
| namespace PRNG { |
This file contains hidden or 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
| #ifndef ICOSPHERE_H | |
| #define ICOSPHERE_H | |
| #include <allegro5/allegro.h> | |
| #include <vector> | |
| #include <map> | |
| #include <algorithm> | |
| #include <memory> | |
| #include "GraphicsTypes.h" | |
| #include "DisplayObject3D.h" |
This file contains hidden or 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
| #include <string.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <stdint.h> | |
| #define BUFSIZE (64) | |
| int get_msr_value(uint64_t* reg_value) { | |
| const char* cmd = "rdmsr -u 0x1FC"; | |
| char cmd_buf[BUFSIZE]; |
This file contains hidden or 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
| #ifndef UP_POOL_STRING_H_INCLUDED | |
| #define UP_POOL_STRING_H_INCLUDED | |
| #include <cstddef> | |
| #include <string> | |
| #include "uP_allocator.h" | |
| namespace uP_pool_string { |
This file contains hidden or 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
| // Allocate memory | |
| pointer allocate(size_type count = 1, const_pointer /* hint */ = nullptr) | |
| { | |
| if (count > _m_num_free_blocks * max_size()) { | |
| throw std::bad_alloc(); | |
| } | |
| if (_m_num_initialized < _m_num_blocks) { | |
| auto p = reinterpret_cast<size_t*>(_addr_from_index(_m_num_initialized)); | |
| *p = _m_num_initialized + 1; |
This file contains hidden or 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
| #include <cstdint> | |
| #include <vector> | |
| #include <memory> | |
| #include <algorithm> | |
| #include <random> | |
| #include <iostream> | |
| template <typename T> | |
| class Foo { |
NewerOlder