Amiga-C (46/223)

From:Sensei
Date:11 Aug 2001 at 02:16:38
Subject:[amiga-c] Allocating FileInfoBlock (Re: ExamineFH)

Czesc Alexander!

Dnia 10-Aug-01, Alexander Niven-Jenkins napisa�:

> Firstly you need to allocate the memory for "fibb" as you have just
> declared a pointer; secondly most of the OS dos routines need aligned data
> so you need to allocate it with something like AllocVec(). See a quick
> example below.

All exec.library memory allocation functions are returning at least 4 byte
aligned memory, so you can use AllocMem() as well.

If you're allocating FileInfoBlock structure you should use AllocDosObject(
DOS_FIB, NULL ); and free it using FreeDosObject( DOS_FIB, fib ); instead of
AllocMem()/AllocVec() or anything else...

Twelvebullets remember, when you're allocating resources you HAVE TO check
return value! It's VERY bad if you're not doing it even in test/example
program...

Regards!



Can your ImageFX paint like bitmap painters?
Download: gfx/ifx/REDFiX.lha, ftp.novadesign.com

Przemyslaw 'SENSEI' Gruchala

code/gfx2d/gfx3d/webmaster

Amiga 1200
Apollo 1240/33 MHz, 18 MB RAM, BTC 33.6 bps
HDD 3.2 GB, HDD 520 MB, CD x12



Chcialbys zarobic lub "dorobic" naprawde dobre pieniadze?
Otrzymasz do 300zl za kazda firme ktora wprowadzisz do Centrum e-biznesu
Poszukaj wsrod znajomych, znajdz firme i wypelnij z nia prosty formularz
Aby rozpoczac wejdz do http://praca.getin.pl i zostan Partnerem Getin

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/