1d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reck/* 2d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reck * Copyright 2012, The Android Open Source Project 3d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reck * 4d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reck * Redistribution and use in source and binary forms, with or without 5d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reck * modification, are permitted provided that the following conditions 6d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reck * are met: 7d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reck * * Redistributions of source code must retain the above copyright 8d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reck * notice, this list of conditions and the following disclaimer. 9d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reck * * Redistributions in binary form must reproduce the above copyright 10d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reck * notice, this list of conditions and the following disclaimer in the 11d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reck * documentation and/or other materials provided with the distribution. 12d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reck * 13d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reck * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 14d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reck * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reck * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 16d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reck * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 17d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reck * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reck * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 19d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reck * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 20d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reck * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 21d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reck * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reck * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reck * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reck */ 25d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reck#define LOG_TAG "GraphicsOperation" 26d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reck 27d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reck#include "config.h" 28d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reck#include "GraphicsOperation.h" 29d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reck 30d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reck#include "AndroidLog.h" 31a2c5f805f838b31fbbeb248aa021e0cf0c758d7bChris Craik#include <utils/LinearAllocator.h> 32d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reck 33d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Recknamespace WebCore { 34d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Recknamespace GraphicsOperation { 35d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reck 36a2c5f805f838b31fbbeb248aa021e0cf0c758d7bChris Craikvoid* Operation::operator new(size_t size, android::LinearAllocator* allocator) 37d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reck{ 38d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reck return allocator->alloc(size); 39d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reck} 40d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reck 41d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reckvoid* Operation::operator new(size_t size) 42d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reck{ 43d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reck ALOGE("Cannot allocate a new Operation directly!"); 44d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reck CRASH(); 45d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reck return (void*) 0xBADBEEF; 46d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reck} 47d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reck 48d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reckvoid Operation::operator delete(void*) 49d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reck{ 50d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reck ALOGE("Cannot call delete on an Operation!"); 51d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reck CRASH(); 52d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reck} 53d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reck 54d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reck} // namespace GraphicsOperation 55d9779adc025ab665fde1c9983e7793e96ab56d4eJohn Reck} // namespace WebCore 56