Пример #1
0
void String::free()
{
    if (elements) {
        std::for_each(elements, end, [this](char &c){ alloc.destroy(&c); });
        alloc.deallocate(elements, end - elements);
    }   
}
Пример #2
0
void StrVec::free() {
	if (elements) {
		for (auto p = first_free; p != elements;) {
			alloc.destroy(--p);
		}
		alloc.deallocate(elements, cap - elements);
	}
}
Пример #3
0
inline void BigNumber::release()
{//Free BigNumber space
    if(first_free){
        while(first_free != val) alloc.destroy(--first_free);
        alloc.deallocate(val,cap);
    }
    val=first_free=NULL;
    cap=len=dot=0;
}
Пример #4
0
inline BigNumber::~BigNumber()
{//Destructor
    if(val){
        for(;first_free!=val;)
            alloc.destroy(--first_free);
        alloc.deallocate(val,cap);
    }
    val=first_free=NULL;
    cap=0;
    dot=len=0;
}
Пример #5
0
void String::free()
{
    for(char *p = s;p < s+sz;++p)
        alloc.destroy(p);
    alloc.deallocate(s,sz);
}
Пример #6
0
 static void destroy(T* ptr) {
     alloc_.destroy(ptr);
     alloc_.deallocate(ptr, 1);
 }