11 #define MAGICKCORE_IMPLEMENTATION 1
12 #define MAGICK_PLUSPLUS_IMPLEMENTATION 1
14 #include "Magick++/Include.h"
15 #include "Magick++/BlobRef.h"
16 #include "Magick++/Exception.h"
17 #include "Magick++/Thread.h"
21 Magick::BlobRef::BlobRef(
const void* data_,
const size_t length_)
22 : allocator(Magick::Blob::NewAllocator),
28 if (data_ != (
const void*) NULL)
30 data=
new unsigned char[length_];
31 memcpy(data,data_,length_);
35 Magick::BlobRef::~BlobRef(
void)
37 if (allocator == Magick::Blob::NewAllocator)
39 delete[]
static_cast<unsigned char*
>(data);
42 else if (allocator == Magick::Blob::MallocAllocator)
43 data=(
void *) RelinquishMagickMemory(data);
46 size_t Magick::BlobRef::decrease()
55 throwExceptionExplicit(MagickCore::OptionError,
56 "Invalid call to decrease");
64 void Magick::BlobRef::increase()