"Fossies" - the Fresh Open Source Software Archive

Member "Hoard-3.13/src/include/hoard/emptyhoardmanager.h" (2 Jan 2019, 1637 Bytes) of package /linux/misc/Hoard-3.13.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "emptyhoardmanager.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 3.12_vs_3.13.

    1 // -*- C++ -*-
    2 
    3 
    4 /*
    5 
    6   The Hoard Multiprocessor Memory Allocator
    7   www.hoard.org
    8 
    9   Author: Emery Berger, http://www.emeryberger.com
   10  
   11   Copyright (c) 1998-2018 Emery Berger
   12   
   13   This program is free software; you can redistribute it and/or modify
   14   it under the terms of the GNU General Public License as published by
   15   the Free Software Foundation; either version 2 of the License, or
   16   (at your option) any later version.
   17   
   18   This program is distributed in the hope that it will be useful,
   19   but WITHOUT ANY WARRANTY; without even the implied warranty of
   20   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   21   GNU General Public License for more details.
   22   
   23   You should have received a copy of the GNU General Public License
   24   along with this program; if not, write to the Free Software
   25   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   26 
   27 */
   28 
   29 #ifndef HOARD_EMPTYHOARDMANAGER_H
   30 #define HOARD_EMPTYHOARDMANAGER_H
   31 
   32 #include "basehoardmanager.h"
   33 
   34 #include "heaplayers.h"
   35 // #include "sassert.h"
   36 
   37 namespace Hoard {
   38 
   39   template <class SuperblockType_>
   40     class EmptyHoardManager : public BaseHoardManager<SuperblockType_> {
   41   public:
   42 
   43     EmptyHoardManager (void)
   44       : _magic (0x1d2d3d40)
   45       {}
   46 
   47     int isValid (void) const {
   48       return (_magic == 0x1d2d3d40);
   49     }
   50 
   51     typedef SuperblockType_ SuperblockType;
   52 
   53     void free (void *) { abort(); }
   54     void lock (void) {}
   55     void unlock (void) {}
   56 
   57     SuperblockType * get (size_t, EmptyHoardManager *) { abort(); return nullptr; }
   58     void put (SuperblockType *, size_t) { abort(); }
   59 
   60   private:
   61 
   62     unsigned long _magic;
   63 
   64   };
   65 
   66 }
   67 #endif