Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/GAP/pkg/digraphs/src/   (Algebra von RWTH Aachen Version 4.15.1©)  Datei vom 27.8.2025 mit Größe 874 B image not shown  

Quelle  safemalloc.c   Sprache: C

 
/********************************************************************************
**
*A  safemalloc.c              Safer memory allocation
**
**
**  Copyright (C) 2024 - Daniel Pointon, J. D. Mitchell
**
**  This file is free software, see the digraphs/LICENSE.
**
********************************************************************************/


#include "safemalloc.h"

#include <stdlib.h>  // for malloc

#include "gap-includes.h"

void* safe_malloc(size_t size) {
  void* allocation = malloc(size);
  if (allocation == NULL) {
    ErrorQuit("Call to malloc(%d) failed, giving up!", (Int) size, 0L);
  }
  return allocation;
}

void* safe_calloc(size_t nitems, size_t size) {
  void* allocation = calloc(nitems, size);
  if (allocation == NULL) {
    ErrorQuit(
        "Call to calloc(%d, %d) failed, giving up!", (Int) nitems, (Int) size);
  }

  return allocation;
}

95%


¤ Dauer der Verarbeitung: 0.12 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung ist noch experimentell.