다음을 통해 공유


매크로

헤더는 다음 매크로를 제공합니다.

ALLOCATOR_DECL

할당자 클래스 템플릿을 생성합니다.

#define ALLOCATOR_DECL(cache, sync, name) <alloc_template>

설명

매크로는 동기화 필터 와 형식의 캐시를 사용하는 할당자 클래스 템플릿을 함께 정의하는 템플릿 정의 및 특수화를 생성합니다.

rebind를 컴파일할 수 있는 컴파일러의 경우, 결과 템플릿 정의는 다음과 같습니다.

struct rebind
   {    /* convert a name<Type> to a name<Other> */
   typedef name<Other> other;
   };

rebind를 컴파일할 수 없는 컴파일러의 경우, 결과 템플릿 정의는 다음과 같습니다.

template <class Type<class name
    : public stdext::allocators::allocator_base<Type,
    sync<stdext::allocators::rts_alloc<cache>>>
{
public:
    name() {}
    template <class Other>
    name(const name<Other>&) {}
    template <class Other>
    name& operator= (const name<Other>&)
    {
        return *this;
    }
};

CACHE_CHUNKLIST

을 생성합니다.

#define CACHE_CHUNKLIST <cache_class>

CACHE_FREELIST

을 생성합니다.

#define CACHE_FREELIST(max) <cache_class>

CACHE_SUBALLOC

을 생성합니다.

#define CACHE_SUBALLOC <cache_class>

SYNC_DEFAULT

동기화 필터를 생성합니다.

#define SYNC_DEFAULT <sync_template>

설명

컴파일러가 단일 스레드 및 다중 스레드 애플리케이션 컴파일을 모두 지원하는 경우 단일 스레드 애플리케이션에 대해 매크로는 을 생성하고, 다른 모든 경우 를 생성합니다.

참고 항목

할당자