Git Product home page Git Product logo

memorypool-2's Introduction

MemoryPool

c++ / Windows xp~ / Visualstudio 2015~

//----------------

프로젝트 우선순위

  1. 스레드 세이프
  2. 부가적인 메모리 소모비용의 최소화
  3. 속도
  4. 범용성을 위해 사용하지 않는 메모리는 가능한 해제를 시도

//----------------

사용 요구사항 visual studio 2015 C++

실행 요구사항 visual studio 2015 C++ 또는, Visual Studio 2015용 Visual C++ 재배포 가능 패키지 https://www.microsoft.com/ko-kr/download/details.aspx?id=48145

//----------------

구성 Core_x86.dll Windows XP 이상 Core_x64.dll Windows Vista 이상 ※ 문자 집합 : 유니코드

//----------------

사용 방법 1 Project_C/Library Public Version/Core Library BETA 2.0 을 사용

초기화를 처리할 cpp 파일에서 다음 파일을 포함(include)
	./User/Core_import.h
초기화
	::CORE::Connect_CORE(...)
종료(명시적 종료 시점이 필요할때만 사용)
	::CORE::Disconnect_CORE

사용을 위해서는 다음 파일을 포함(include)
	./User/Core_include.h

//----------------

사용 방법 2 Project_C/SourceCode/Engine 라이브러리 import  또는 코드를 참고

//----------------

인터페이스는 다음 파일들을 참조 Core_Interface.h MemoryPool_Interface.h System_Information_Interface.h

디버깅용 로그 필요시 다음 파일을 참조하여 객체를 정의하여, 초기화시 인스턴스를 전달해야 함 LogWriter_Interface.h

pLogSystem	중요한 오류등을 기록
pLogDebug	일반 디버깅 정보

/ 사용법 : / (다음의 방법들은 모두 혼용사용이 가능합니다) / / #1) 메모리풀을 적용하려는 객체는 CMemoryPoolResource를 상속받습니다. / 예:) class CTest1 : public CMemoryPoolResource / 예:) struct TTest1 : CMemoryPoolResource / new delete 를 이용하여 사용합니다. / ※ 이미 작성된 코드에 쉽게 적용하는데 유리합니다. / ※ 주의 : 자식 클래스까지 모두 메모리풀의 영향을 받습니다. / / #2) 객체단위에 대하여 만약 상속을 사용하지 않고 특정상황에만 사용하고 싶다면 / 다음의 매크로를 사용합니다. / (CMemoryPoolResource를 상속 받은 타입또한 가능합니다.) / ■ 매크로 버전 : 할당자 / 소멸자 비 호출 / _MACRO_ALLOC__FROM_MEMORYPOOL(Address) / _MACRO_FREE__FROM_MEMORYPOOL(Address) / ■ 매크로 버전 : 할당자 / 소멸자 호출 / _MACRO_NEW__FROM_MEMORYPOOL(Address, Constructor) / _MACRO_DELETE__FROM_MEMORYPOOL(Address) / / / #3) 만약 할당하려는 크기가 가변적(예를 들어 문자열버퍼) 이라면 / 메모리풀관리자에 직접 접근하여 다음의 메소드를 사용합니다 / IMemoryPool_Manager::mFN_Get_Memory / IMemoryPool_Manager::mFN_Return_Memory / IMemoryPool_Manager::mFN_Get_Memory__AlignedCacheSize // 캐시라인 정렬 버전 / IMemoryPool_Manager::mFN_Return_Memory__AlignedCacheSize // 캐시라인 정렬 버전 / ■ 매크로 버전 : 할당자 / 소멸자 비 호출 / _MACRO_ALLOC__FROM_MEMORYPOOL_GENERIC / _MACRO_FREE__FROM_MEMORYPOOL_GENERIC / ※ malloc / free 를 대신하기에 적합한 방법입니다. / / 사용법(기타) : / STL Container 의 Allocator 교체 할 경우 다음을 사용 / TAllocator / 이것은 vector 같은 매우 가변적 크기 할당에 사용하지 않는 것이 좋습니다

memorypool-2's People

Contributors

lastpenguin avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.