次の方法で共有


max_unbounded Class

 

The latest version of this topic can be found at max_unbounded Class.

Describes a max class object that does not limit the maximum length of a freelist object.

Syntax

class max_unbounded

Member Functions

allocated Increments the count of allocated memory blocks.
deallocated Decrements the count of allocated memory blocks.
full Returns a value that specifies whether more memory blocks should be added to the free list.
released Decrements the count of memory blocks on the free list.
saved Increments the count of memory blocks on the free list.

Requirements

Header: <allocators>

Namespace: stdext

max_unbounded::allocated

Increments the count of allocated memory blocks.

void allocated(std::size_t _Nx = 1);

Parameters

Parameter Description
_Nx The increment value.

Remarks

This member function does nothing. It is called after each successful call by cache_freelist::allocate to operator new. The argument _Nx is the number of memory blocks in the chunk allocated by operator new.

max_unbounded::deallocated

Decrements the count of allocated memory blocks.

void deallocated(std::size_t _Nx = 1);

Parameters

Parameter Description
_Nx The increment value.

Remarks

The member function does nothing. This member function is called after each call by cache_freelist::deallocate to operator delete. The argument _Nx is the number of memory blocks in the chunk deallocated by operator delete.

max_unbounded::full

Returns a value that specifies whether more memory blocks should be added to the free list.

bool full();

Return Value

The member function always returns false.

Remarks

This member function is called by cache_freelist::deallocate. If the call returns true, deallocate puts the memory block on the free list; if it returns false, deallocate calls operator delete to deallocate the block.

max_unbounded::released

Decrements the count of memory blocks on the free list.

void released();

Remarks

This member function does nothing. The released member function of the current max class is called by cache_freelist::allocate whenever it removes a memory block from the free list.

max_unbounded::saved

Increments the count of memory blocks on the free list.

void saved();

Remarks

This member function does nothing. It is called by cache_freelist::deallocate whenever it puts a memory block on the free list.

See Also

<allocators>