< prev index next >

src/hotspot/share/memory/arena.hpp

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 197,212 **** return old; } } // Fast delete in area. Common case is: NOP (except for storage reclaimed) ! void Afree(void *ptr, size_t size) { #ifdef ASSERT if (ZapResourceArea) memset(ptr, badResourceValue, size); // zap freed memory ! if (UseMallocOnly) return; #endif ! if (((char*)ptr) + size == _hwm) _hwm = (char*)ptr; } void *Arealloc( void *old_ptr, size_t old_size, size_t new_size, AllocFailType alloc_failmode = AllocFailStrategy::EXIT_OOM); --- 197,218 ---- return old; } } // Fast delete in area. Common case is: NOP (except for storage reclaimed) ! bool Afree(void *ptr, size_t size) { #ifdef ASSERT if (ZapResourceArea) memset(ptr, badResourceValue, size); // zap freed memory ! if (UseMallocOnly) return true; #endif ! if (((char*)ptr) + size == _hwm) { ! _hwm = (char*)ptr; ! return true; ! } else { ! // Unable to fast free, so we just drop it. ! return false; ! } } void *Arealloc( void *old_ptr, size_t old_size, size_t new_size, AllocFailType alloc_failmode = AllocFailStrategy::EXIT_OOM);
< prev index next >