Open
Graph Drawing
Framework

 v.2010.10
 

Classes | Namespaces | Defines | Typedefs

memory.h File Reference

Declaration of memory manager for allocating small pieces of memory. More...

#include <windows.h>
#include <stdlib.h>
#include <new>
#include <ogdf/internal/basic/PoolMemoryAllocator.h>
#include <ogdf/internal/basic/MallocMemoryAllocator.h>

Go to the source code of this file.

Classes

struct  MemElem

Namespaces

namespace  ogdf
 

The namespace for all OGDF objects.


Defines

#define WIN32_EXTRA_LEAN
#define WIN32_LEAN_AND_MEAN
#define NOMINMAX
#define _WIN32_WINNT   0x0500
#define OGDF_MEMORY_POOL_TS
#define OGDF_MM(Alloc)
#define OGDF_NEW   new
#define OGDF_ALLOCATOR   ogdf::PoolMemoryAllocator
#define OGDF_NEW_DELETE   OGDF_MM(OGDF_ALLOCATOR)
 Creates new and delete operators in a class using ogdf's memory allocator.
#define OGDF_MALLOC_NEW_DELETE   OGDF_MM(MallocMemoryAllocator)
 Creates new and delete operators in a class using the malloc memory allocator.

Typedefs

typedef MemElemMemElemPtr

Detailed Description

Declaration of memory manager for allocating small pieces of memory.

Author:
Carsten Gutwenger
License:
This file is part of the Open Graph Drawing Framework (OGDF).

Copyright (C). All rights reserved. See README.txt in the root directory of the OGDF installation for details.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License Version 2 or 3 as published by the Free Software Foundation and appearing in the files LICENSE_GPL_v2.txt and LICENSE_GPL_v3.txt included in the packaging of this file.
In addition, as a special exception, you have permission to link this software with the libraries of the COIN-OR Osi project (http://www.coin-or.org/projects/Osi.xml), all libraries required by Osi, and all LP-solver libraries directly supported by the COIN-OR Osi project, and distribute executables, as long as you follow the requirements of the GNU General Public License in regard to all of the software in the executable aside from these third-party libraries.
This program 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 GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
See also:
http://www.gnu.org/copyleft/gpl.html

Definition in file memory.h.


Define Documentation

#define _WIN32_WINNT   0x0500

Definition at line 66 of file memory.h.

#define NOMINMAX

Definition at line 64 of file memory.h.

#define OGDF_ALLOCATOR   ogdf::PoolMemoryAllocator

Definition at line 128 of file memory.h.

#define OGDF_MALLOC_NEW_DELETE   OGDF_MM(MallocMemoryAllocator)

Creates new and delete operators in a class using the malloc memory allocator.

Definition at line 135 of file memory.h.

#define OGDF_MEMORY_POOL_TS

Definition at line 96 of file memory.h.

#define OGDF_MM (   Alloc  ) 
Value:
public: \
void *operator new(size_t nBytes) { \
    if(OGDF_LIKELY(Alloc::checkSize(nBytes))) \
        return Alloc::allocate(nBytes); \
    else \
    return MallocMemoryAllocator::allocate(nBytes); \
} \
void *operator new(size_t, void *p) { return p; } \
void operator delete(void *p, size_t nBytes) { \
    if(OGDF_LIKELY(p != 0)) { \
        if(OGDF_LIKELY(Alloc::checkSize(nBytes))) \
            Alloc::deallocate(nBytes, p); \
        else \
            MallocMemoryAllocator::deallocate(nBytes, p); \
    } \
}

Definition at line 105 of file memory.h.

#define OGDF_NEW   new

Definition at line 123 of file memory.h.

#define OGDF_NEW_DELETE   OGDF_MM(OGDF_ALLOCATOR)

Creates new and delete operators in a class using ogdf's memory allocator.

Definition at line 132 of file memory.h.

#define WIN32_EXTRA_LEAN

Definition at line 62 of file memory.h.

#define WIN32_LEAN_AND_MEAN

Definition at line 63 of file memory.h.


Typedef Documentation

typedef MemElem* MemElemPtr

Definition at line 75 of file memory.h.