프로그래밍
-
메모리 풀과 오브젝트 풀프로그래밍/내 라이브러리 2021. 2. 7. 16:24
예전에 만들어 본 메모리 풀이 있는데, 최근 보니 코드가 가운데 정렬되어 있길래 글을 지우고 겸사겸사 새로 만들었다. 고정된 크기의 메모리를 풀링하는 FixedSizeMemoryPool과 오브젝트를 풀링하는 ObjectPool이다. 별도의 테스트는 하지 않았고 기존 코드를 조금 가다듬어 표기법과 인덴트만 편집 했다. ^ㅅ^ github.com/zepeh92/FixedSizeMemoryPool.git zepeh92/FixedSizeMemoryPool Contribute to zepeh92/FixedSizeMemoryPool development by creating an account on GitHub. github.com github.com/zepeh92/ObjectPool.git zepeh92/Obje..
-
Graceful Shutdown, Linger Options, and Socket Closure프로그래밍 2021. 1. 3. 00:55
Graceful Shutdown, Linger Options, and Socket Closure - Win32 apps | Microsoft Docs Graceful Shutdown, Linger Options, and Socket Closure - Win32 apps Graceful Shutdown, Linger Options, and Socket Closure In this article --> The following material is provided as clarification for the subject of shutting down socket connections closing the sockets. It is important to distinguish the difference be..
-
신기한 Unity Engine의 Destroy프로그래밍/의문 2020. 12. 13. 01:13
Unity에서 어떤 GameObject를 Destroy 되면, 그 GameObject를 참조하는 다른 곳에서도 null체크 할 수 있더라. 상식적으로는 댕글링 포인터가 되어야 하는데 말이다. public class A : MonoBehaviour { GameObject monster; // B의 monster와 같은 인스턴스 // ... void Test() { Destroy(monster); } } public class B : MonoBehaviour { GameObject monster; // A의 monster와 같은 인스턴스 // ... void Test() { if (monster == null) {// A에서 Destroy를 했는데 B에서 null체크가 됨! } } } 사실 이는 일종의 트릭..
-
std::array<bool, N> 은 비트를 다루도록 특수화 되어있지 않음프로그래밍/c++ 2020. 12. 1. 12:33
std::vector은 내부적으로 bitset처럼 다뤄지도록 템플릿 특수화가 되어있다. std::vector - cppreference.com std::vector - cppreference.com template class vector ; std::vector is a possibly space-efficient specialization of std::vector for the type bool. The manner in which std::vector is made space efficient (as well as whether it is optimized at all) is implementation defined. One potential en.cppreference.com 그런데 std::ar..
-
코드 스멜(CODE SMELL)프로그래밍/기록, 개념, 용어 2020. 10. 29. 13:50
ko.wikipedia.org/wiki/%EC%BD%94%EB%93%9C_%EC%8A%A4%EB%A9%9C 코드 스멜 - 위키백과, 우리 모두의 백과사전 위키백과, 우리 모두의 백과사전. 둘러보기로 가기 검색하러 가기 코드 스멜(code smell←코드 냄새)은 컴퓨터 프로그래밍 코드에서 더 심오한 문제를 일으킬 가능성이 있는 프로그램 소스 코드의 ko.wikipedia.org 코드 스멜(code smell←코드 냄새)은 컴퓨터 프로그래밍 코드에서 더 심오한 문제를 일으킬 가능성이 있는 프로그램 소스 코드의 특징을 가리킨다.
-
Concepts프로그래밍/c++ 2020. 10. 20. 13:18
특정 함수 요구 샘플 #include #include #include template concept Serializable = requires(T v, std::ostream & is) { v.Serialize(is); }; template concept Deserializable = requires(T v, std::istream & is) { v.Deserialize(is); }; template concept Convertable = Serializable && Deserializable; template void Serialize(T& v) { } template < Deseriali..