🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: fr.comp.lang.c
Article #15503

Re: memcpy et char

#15503
From: Emmanuel Delahaye
Date: Fri, 23 Sep 2005 17:41
32 lines
2121 bytes
Harpo wrote on 23/09/05 :
> Emmanuel Delahaye wrote:
>>>     char ch[taille + 1];
>> 
>> [C99] VLA ? Je ne connais pas d'impl�mentation conforme. Qu'est-ce qui
>> ne va pas avec malloc() ?
>
> Ca co�te cher.

En terme de quoi ? Temps d'ex�cution, taille, m�moire ?

> On peut essayer alloca( ) en de�� d'une certaine taille en testant si le
> syst�me le permet, 

Comment on teste ?

> je ne vois sinon aucune raison particuli�re de ne
> pas allouer dans la pile.

VLA : Un crash est possible (d�bordement de pile). En cas d'echec 
d'allocation, il n'y a pas de contr�le possible. On travaille sans 
filet.

Quand � alloca(), c'est une extension, et si j'ai bien suivi, elle est 
obsol�te, d�conseill�e, et il est sugg�r� de la remplacer par malloc().

-- 
Emmanuel
The C-FAQ: http://www.eskimo.com/~scs/C-faq/faq.html
The C-library: http://www.dinkumware.com/refxc.html

.sig under repair
Technical Details
Message-ID: <mn.bc9d7d593641825a.15512@YOURBRAnoos.fr>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!83.128.0.11.MISMATCH!news-out1.kabelfoon.nl!newsfeed.kabelfoon.nl!xindi.nntp.kabelfoon.nl!news.astraweb.com!newsrouter-eu.astraweb.com!proxad.net!infeed-3.proxad.net!news18-e.free.fr!not-for-mail
References: <4333e995$0$17469$626a14ce@news.free.fr> <mn.bc1f7d598a134f88.15512@YOURBRAnoos.fr> <4334381a$0$20167$8fcfb975@news.wanadoo.fr>

Show Full Headers
Complete Article Headers
X-Google-Thread: f9822,366ad66ae342f8da
X-Google-Attributes: gidf9822,public
X-Google-Language: FRENCH,ASCII
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!83.128.0.11.MISMATCH!news-out1.kabelfoon.nl!newsfeed.kabelfoon.nl!xindi.nntp.kabelfoon.nl!news.astraweb.com!newsrouter-eu.astraweb.com!proxad.net!infeed-3.proxad.net!news18-e.free.fr!not-for-mail
Subject: Re: memcpy et char
From: "Emmanuel Delahaye" <emdel@YOURBRAnoos.fr>
References: <4333e995$0$17469$626a14ce@news.free.fr> <mn.bc1f7d598a134f88.15512@YOURBRAnoos.fr> <4334381a$0$20167$8fcfb975@news.wanadoo.fr>
Newsgroups: fr.comp.lang.c
Message-ID: <mn.bc9d7d593641825a.15512@YOURBRAnoos.fr>
X-Newsreader: MesNews/1.04.00.00-fr
Date: Fri, 23 Sep 2005 19:41:33 +0200
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-15"; format=flowed
Content-Transfer-Encoding: 8bit
Lines: 34
Organization: Guest of ProXad - France
NNTP-Posting-Date: 23 Sep 2005 19:41:35 MEST
NNTP-Posting-Host: 81.65.109.78
X-Trace: 1127497295 news18-e.free.fr 4346 81.65.109.78:17127
X-Complaints-To: abuse@proxad.net