예제 #1
0
//////////////
// 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.
}
예제 #2
0
void list_clear(list_t * self) {
    while (self->size > 0) {
        void * val = list_popBack(self);
        _dealloc(self, val);
    }
}
예제 #3
0
/////////////////
// Destructors //
/////////////////
image::~image(void)
{
  _dealloc();
}