delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/05/10/09:17:12

Date: Tue, 10 May 1994 14:18:48 +0200
To: djgpp AT sun DOT soe DOT clarkson DOT edu
From: ahelm AT email DOT tuwien DOT ac DOT at (Anton Helm)
Subject: malloc(), calloc(), free(), cfree() ???

Hi !

ANSI standard says that memory that has been allocated with malloc() can 
only be released by free() and if calloc() is used it can only be released 
by cfree(). 

What is the difference in memory allocation using malloc() or calloc() that 
causes the different release commands ?

My problem is that I should port a program where malloc() and calloc() are 
mixed and only free() is used. Do I have to expect troubles ?


Tony

============================================================================
Office:                           **    Private:
                                  **
Dipl.-Ing. Anton HELM             **
Institut fuer Nachrichtentechnik  **    
und Hochfrequenztechnik           **    Anton HELM
Guszhausstr. 25/389               **    Gratian-Marx Str. 7/27
A-1040 Wien                       **    A-1110 Wien
AUSTRIA                           **    AUSTRIA  
                                  **
Tel.: +43-1-58801-3520            **
FAX : +43-1-5870583               **
                                  **
============================================================================
   ________   __    __           __        __   __   _______   __        __
  /__   __/  / /   / /          / /       / /  / /  / _____/  /  \      / /
    /  /    / /   / /  _____   / /  __   / /  / /  / /____   / /\ \    / /
   /  /    / /   / /  /____/  / /  / /  / /  / /  / _____/  / /  \ \  / /
  /  /    / /___/ /          / /__/ /__/ /  / /  / /____   / /    \ \/ /
 /__/    /_______/          /___________/  /_/  /______/  /_/      \__/

============================================================================


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019