#pragma region CPL License /* Nuclex Native Framework Copyright (C) 2002-2013 Nuclex Development Labs This library is free software; you can redistribute it and/or modify it under the terms of the IBM Common Public License as published by the IBM Corporation; either version 1.0 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the IBM Common Public License for more details. You should have received a copy of the IBM Common Public License along with this library */ #pragma endregion // CPL License #ifndef NUCLEX_STORAGE_FILESYSTEM_SEVENZIP_UNCHECKEDALLOC_H #define NUCLEX_STORAGE_FILESYSTEM_SEVENZIP_UNCHECKEDALLOC_H #include "Nuclex/Storage/Config.h" #include "lzma/7z.h" namespace Nuclex { namespace Storage { namespace FileSystem { namespace SevenZip { // ------------------------------------------------------------------------------------------- // /// Implements 7-Zip's ISzAlloc interface using C++ memory allocation class UncheckedAlloc : public ISzAlloc { /// Initializes a new unchecked C++ memory allocator public: UncheckedAlloc(); /// Allocates at least the specified number of bytes /// The ISzAlloc instance /// Number of bytes that will be allocated /// The start address of the allocated memory private: static void *alloc(void *self, size_t size); /// Frees memory that has been allocated by the alloc() method /// The ISzAlloc instance /// Start address of the allocated memory that will be freed private: static void free(void *self, void *address); }; // ------------------------------------------------------------------------------------------- // }}}} // namespace Nuclex::Storage::FileSystem::SevenZip #endif // NUCLEX_STORAGE_FILESYSTEM_SEVENZIP_UNCHECKEDALLOC_H