delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/03/20/04:06:35

Message-ID: <35122FEE.3C46@acadia.net>
Date: Fri, 20 Mar 1998 03:59:26 -0500
From: Scott Warner <swarnerx3 AT acadia DOT net>
MIME-Version: 1.0
To: THIERRY DOT T DOT I DOT IMMORDINO AT TSI DOT thomson DOT fr
CC: djgpp AT delorie DOT com
Subject: Re: Memory protection
References: <00025A71.MAI*/G=THIERRY/I=TI/S=IMMORDINO/O=TSI/PRMD=THOMSON/ADMD=ATLAS/C=FR/@MHS>

THIERRY DOT T DOT I DOT IMMORDINO AT TSI DOT thomson DOT fr wrote:
> 
> Hi,
> 
> How can I protect, some part of the memory (variables, task stack, ..) from
> overwrites ? (mprotect perhaps )
> 
> Thierry

I believe this is the function of malloc() and new, in C and C++
respectively.  Both return pointers to an allocated area of memory of
the size requested.  If the memory is unavailable, malloc() and new
return NULL pointers.  Without this areas of memory can easily be
overwritten.

- Raw text -


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