• Navigation überspringen
  • Zur Navigation
  • Zum Seitenende
Organisationsmenü öffnen Organisationsmenü schließen
Friedrich-Alexander-Universität Lehrstuhl für Informatik 4 (Systemsoftware)
  • FAUZur zentralen FAU Website
  1. Friedrich-Alexander-Universität
  2. Technische Fakultät
  3. Department Informatik
Suche öffnen
  • English
  • Campo
  • StudOn
  • FAUdir
  • Stellenangebote
  • Lageplan
  • Hilfe im Notfall
  1. Friedrich-Alexander-Universität
  2. Technische Fakultät
  3. Department Informatik
Friedrich-Alexander-Universität Lehrstuhl für Informatik 4 (Systemsoftware)
Menu Menu schließen
  • Lehrstuhl
    • Team
    • Aktuelles
    • Kontakt und Anfahrt
    • Leitbild
    • 50-jähriges Jubiläum
    Portal Lehrstuhl
  • Forschung
    • Forschungsbereiche
      • Betriebssysteme
      • Confidential Computing
      • Embedded Systems Software
      • Verteilte Systeme
    • Projekte
      • AIMBOS
      • BALu
      • BFT2Chain
      • DOSS
      • Mirador
      • NEON
      • PAVE
      • ResPECT
      • Watwa
    • Projektkampagnen
      • maRE
    • Seminar
      • Systemsoftware
    Portal Forschung
  • Publikationen
  • Lehre
    • Wintersemester 2025/26
      • Systemprogrammierung 2
      • Betriebssysteme
      • Middleware – Cloud Computing
      • Echtzeitsysteme
      • Virtuelle Maschinen
      • Web-basierte Systeme
      • Projekt angewandte Systemsoftwaretechnik
      • Aktuelle Entwicklung in Verteilten und Objektorientierten Betriebssystemen (für Bachelor-/Masterarbeit)
    • Sommersemester 2026
      • Applied Software Architecture
      • Betriebssystemsicherheit
      • Betriebssystemtechnik
      • System-Level Programming
      • Systemnahe Programmierung in C
      • Systemprogrammierung 1
      • Verlässliche Echtzeitsysteme
      • Verteilte Systeme
    Portal Lehre
  • Examensarbeiten
  1. Startseite
  2. Extern

Extern

Bereichsnavigation: Lehre
  • Betriebssystemtechnik
    • Übung
      • Aufgaben
      • Dokumentation
        • Blog
          • Entwicklungsumgebung
            • Assembler Crashkurs
              • C++ Crashkurs
                • 🔗 Testrechnerverwaltung
                • Kontakt
              • Evaluation

              C++ Crashkurs

              • utils
              Functions | Constants
              alloc.cc File Reference
              #include "utils/alloc.h"
              #include "utils/alloc_buddy.h"
              #include "utils/math.h"
              #include "utils/string.h"
              #include "machine/cache.h"
              #include "debug/assert.h"
              + Include dependency graph for alloc.cc:

              Functions

              static void * reserve (void *start, size_t size)
               Memory reservation function for allocator Will return memory from a statically allocated char array in bss.
               
              void * malloc (size_t size)
               Allocate a memory block The memory is not initialized.
               
              void free (void *ptr)
               Free an allocated memory block.
               
              void * realloc (void *ptr, size_t size)
               Change the size of an allocated memory block The contents will be unchanged in the range from the start of the region up to the minimum of the old and new sizes. If the new size is larger than the old size, the added memory will not be initialized.
               
              void * calloc (size_t nmemb, size_t size)
               Allocate memory for an array of elements The memory is set to zero.
               

              Constants

              cache_aligned bool in_use = false
               Concurrent access is not allowed Use assertions to detect bugs.
               
              static const size_t ALLOC_LOG2 = 22
               Reserved memory size as power of 2.
               
              static const size_t mem_size = 1 << ALLOC_LOG2
               (Resulting) reserved memory size
               
              static char mem [mem_size]
               Reserved memory (will be statically allocated in bss)
               
              static Allocator::Buddy< 4, ALLOC_LOG2, sizeof(size_t) *2, reserve > allocator
               Instantiate a Buddy allocator using the custom reserve function.
               

              Function Documentation

              static void * reserve ( void *  start,
              size_t  size 
              )
              static

              Memory reservation function for allocator Will return memory from a statically allocated char array in bss.

              Parameters
              startStart address for requested memory, if nullptr it will use the pointer to the char array instead
              sizeRequested memory size
              Returns
              If the requested size after the start address is within the allocated char array, the start address is returned – nullptr otherwise.
              void * malloc ( size_t  size)

              Allocate a memory block The memory is not initialized.

              Parameters
              sizeRequested size of memory in bytes.
              Returns
              Pointer to memory or nullptr on error (no memory available) or if size was zero.
              void free ( void *  ptr)

              Free an allocated memory block.

              Parameters
              ptrPointer to an previously allocated memory block.
              void * realloc ( void *  ptr,
              size_t  size 
              )

              Change the size of an allocated memory block The contents will be unchanged in the range from the start of the region up to the minimum of the old and new sizes. If the new size is larger than the old size, the added memory will not be initialized.

              Parameters
              ptrPointer to an previously allocated memory block. If nullptr, then the call is equivalent to malloc().
              sizeNew size of the memory block. If equal to zero, then the call is equivalent to free
              Returns
              Pointer to new memory block or nullptr on error
              void * calloc ( size_t  nmemb,
              size_t  size 
              )

              Allocate memory for an array of elements The memory is set to zero.

              Parameters
              nmembNumber of elements
              sizeSize of an element in bytes
              Returns
              pointer to the allocated memory or nullptr if the request fails

              Variable Documentation

              cache_aligned bool in_use = false

              Concurrent access is not allowed Use assertions to detect bugs.

              const size_t ALLOC_LOG2 = 22
              static

              Reserved memory size as power of 2.

              const size_t mem_size = 1 << ALLOC_LOG2
              static

              (Resulting) reserved memory size

              char mem[mem_size]
              static

              Reserved memory (will be statically allocated in bss)

              Allocator::Buddy<4, ALLOC_LOG2, sizeof(size_t) * 2, reserve> allocator
              static

              Instantiate a Buddy allocator using the custom reserve function.

              Friedrich-Alexander-Universität
              Erlangen-Nürnberg

              Schlossplatz 4
              91054 Erlangen
              • Impressum
              • Datenschutz
              • Barrierefreiheit
              • Facebook
              • RSS Feed
              • Xing
              Nach oben