2 * (c) 2008-2009 Alexander Warg <warg@os.inf.tu-dresden.de>
3 * economic rights: Technische Universität Dresden (Germany)
5 * This file is part of TUD:OS and distributed under the terms of the
6 * GNU General Public License 2.
7 * Please see the COPYING-GPL-2 file for details.
12 #include <l4/cxx/slab_alloc.h>
13 #include <l4/cxx/std_tmpl.h>
15 #include "page_alloc.h"
17 template< int Obj_size >
18 class Slab_alloc_fn : public cxx::Base_slab<Obj_size, L4_PAGESIZE, 2, Single_page_alloc>
23 Slab_alloc_fn<size> &__get_slab_allocator(cxx::Int_to_type<size> const &)
25 static Slab_alloc_fn<size> s;
30 void *operator new (size_t size)
32 if (size <= sizeof(unsigned long))
33 return __get_slab_allocator(cxx::Int_to_type<sizeof(unsigned long)>()).alloc();