"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/include/hoard/redirectfree.h" between
Hoard-3.12.tar.gz and Hoard-3.13.tar.gz

About: The Hoard memory allocator is a drop-in replacement for malloc() that can improve application performance, especially for multithreaded programs running on multiprocessors (hint: newer releases now part of the HeapLayers package).

redirectfree.h  (Hoard-3.12):redirectfree.h  (Hoard-3.13)
// -*- C++ -*- // -*- C++ -*-
/* /*
The Hoard Multiprocessor Memory Allocator The Hoard Multiprocessor Memory Allocator
www.hoard.org www.hoard.org
Author: Emery Berger, http://www.cs.umass.edu/~emery Author: Emery Berger, http://www.emeryberger.com
Copyright (c) 1998-2012 Emery Berger Copyright (c) 1998-2018 Emery Berger
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
skipping to change at line 91 skipping to change at line 91
s->lock(); s->lock();
// By acquiring the lock on the superblock (above), // By acquiring the lock on the superblock (above),
// we prevent it from moving up to a higher heap. // we prevent it from moving up to a higher heap.
// This eventually pins it down in one heap, // This eventually pins it down in one heap,
// so this loop is guaranteed to terminate. // so this loop is guaranteed to terminate.
// (It should generally take no more than two iterations.) // (It should generally take no more than two iterations.)
for (;;) { for (;;) {
owner = reinterpret_cast<baseHeapType>(s->getOwner()); owner = reinterpret_cast<baseHeapType>(s->getOwner());
assert (owner != NULL); assert (owner != nullptr);
assert (owner->isValid()); assert (owner->isValid());
// Lock the owner. If ownership changed between these two lines, // Lock the owner. If ownership changed between these two lines,
// we'll detect it and try again. // we'll detect it and try again.
owner->lock(); owner->lock();
if (owner == reinterpret_cast<baseHeapType>(s->getOwner())) { if (owner == reinterpret_cast<baseHeapType>(s->getOwner())) {
owner->free (ptr); owner->free (ptr);
owner->unlock(); owner->unlock();
s->unlock(); s->unlock();
return; return;
} }
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)