////////////// // Mutators // ////////////// void image::resize(image::size_type newWidth, image::size_type newHeight) { // check if new size == old size if(width() == newWidth && height() == newHeight) return; // dealloc and re-alloc _dealloc(); _alloc(newWidth, newHeight); // Done. }
void list_clear(list_t * self) { while (self->size > 0) { void * val = list_popBack(self); _dealloc(self, val); } }
///////////////// // Destructors // ///////////////// image::~image(void) { _dealloc(); }