Article View: comp.sys.amiga.tech
Article #10858Re: Unsupported Programming Practices
From: Leo L. Schwab
Date: Sat, 07 Jan 1989 07:31
Date: Sat, 07 Jan 1989 07:31
34 lines
2153 bytes
2153 bytes
In article <5632@cbmvax.UUCP> steveb@cbmvax.UUCP (Steve Beats) writes:
>In article <10227@well.UUCP> ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab) writes:
>>In article <5605@cbmvax.UUCP> carolyn@cbmvax.UUCP (Carolyn Scheppner CATS) writes:
>>>Do not execute code on your stack or put system structures on your stack.
>> I occasionally put RastPorts on my stack; does that count?
>>
>Yes that certainly does count. If Exec ever gets its act together and starts
>using the MMU, your stack would be private memory. If graphics attempted to
>access the RastPort (as a separate task through Intuition for instance) it
>would cause an illegal access exception. I would suggest you either:-
>
>a) Allocate rastports using MEMF_PUBLIC
>b) Allocate a new stack using MEMF_PUBLIC
>
AARRGGHHH! What a bloody nuisance. Throwing temproary RastPorts
around on the stack has been a real nice win for me. I've been doing things
like this:
if (loadILBM() == SUCCESS) {
struct RastPort lrp;
InitRastPort (&lrp);
lrp.BitMap = &loaded_bitmap;
ClipBlit (&lrp, 0L, 0L, &dest, 0L, 0L, w, h, MINTERM_COPY);
}
So now I have to do AllocMem()s with sanity checks with
corresponding FreeMem()s? Foo.
_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
Leo L. Schwab -- The Guy in The Cape INET: well!ewhac@ucbvax.Berkeley.EDU
\_ -_ Recumbent Bikes: UUCP: pacbell > !{well,unicom}!ewhac
O----^o The Only Way To Fly. hplabs / (pronounced "AE-wack")
"Work FOR? I don't work FOR anybody! I'm just having fun." -- The Doctor
Technical Details
Message-ID:
<10262@well.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!lll-ncis!helios.ee.lbl.gov!pasteur!ucbvax!bloom-beacon!apple!well!ewhacReferences:
<5605@cbmvax.UUCP> <10227@well.UUCP> <5632@cbmvax.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!lll-ncis!helios.ee.lbl.gov!pasteur!ucbvax!bloom-beacon!apple!well!ewhac From: ewhac@well.UUCP (Leo L. Schwab) Newsgroups: comp.sys.amiga.tech Subject: Re: Unsupported Programming Practices Summary: Poo... Message-ID: <10262@well.UUCP> Date: 7 Jan 89 07:31:32 GMT References: <5605@cbmvax.UUCP> <10227@well.UUCP> <5632@cbmvax.UUCP> Reply-To: ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab) Organization: (-: ACME Flamethrowers. Mark Ethan Smith, CEO. :-) Lines: 34 Quote: "Hip! Hip! Hooray! We're orphans!" -- Dynaman