[comp.sys.mac.programmer] Simple MPW question

mdtaylor@Apple.COM (Mark Taylor) (07/17/90)

Simple question:  when compiling an application under MPW, how do you set the
application's "Suggested Memory Size", i.e. the default heap size?  I thought
it might be a linker option but I can't seem to find one in the manual.

Surely this information is in the manual somewhere, but where?

Thanks!

- Mark

stevec@Apple.COM (Steve Christensen) (07/18/90)

In article <9170@goofy.Apple.COM> mdtaylor@Apple.COM (Mark Taylor) writes:
>Simple question:  when compiling an application under MPW, how do you set the
>application's "Suggested Memory Size", i.e. the default heap size?  I thought
>it might be a linker option but I can't seem to find one in the manual.

Your application needs to have a SIZE resource which, among other things,
tells how it behaves with MultiFinder, and what the minimum and default
heap size should be.  The rez definition of the SIZE resource should be
in types.r...

steve
-- 
____________________________________________________________________

  Steve Christensen             Internet:   stevec@goofy.apple.com
  Apple Computer, Inc.          AppleLink:  CHRISTENSE1
  20525 Mariani Ave, MS 81BB    CompuServe: 76174,1712
  Cupertino, CA  95014          phone:      408-974-4369

  Hacking's just another word for nothing left to kludge.
____________________________________________________________________

mdtaylor@Apple.COM (Mark Taylor) (07/18/90)

In article <9170@goofy.Apple.COM> mdtaylor@Apple.COM (myself) writes:
>Simple question:  when compiling an application under MPW, how do you set the
>application's "Suggested Memory Size", i.e. the default heap size?  I thought
>it might be a linker option but I can't seem to find one in the manual.

Well, thanks very much to all of you who responded so quickly.  As is the case
with most of my questions these days, the answer (set the default heap size in
the SIZE resource, the format for which can be found in {RIncludes}Types.r) is
obvious - once you know it.  (I've been using THINK C up until now, forgetting
that THINK C has been creating SIZE resources for me.)

Paul Snively summed it up best by saying:
"It's in _a_ manual; it's just not obvious _which_ manual. :-)"

Thanks again to all.

- Mark

oster@well.sf.ca.us (David Phillip Oster) (07/20/90)

To set the suggested heap size for a program, include in its resource fork
a resource of type=SIZE, id=-1. You can edit these guys in ResEdit, and it is 
usually easier to copy one from some other application than to create it 
from scratch. The documentation in it is in the Multifinder material available
from APDA.
-- 
-- David Phillip Oster - Note new address. Old one has gone Bye Bye.
-- oster@well.sf.ca.us = {backbone}!well!oster

austing@Apple.COM (Glenn L. Austin) (07/20/90)

oster@well.sf.ca.us (David Phillip Oster) writes:

>To set the suggested heap size for a program, include in its resource fork
>a resource of type=SIZE, id=-1. You can edit these guys in ResEdit, and it is 
>usually easier to copy one from some other application than to create it 
>from scratch. The documentation in it is in the Multifinder material available
>from APDA.
>-- 
>-- David Phillip Oster - Note new address. Old one has gone Bye Bye.
>-- oster@well.sf.ca.us = {backbone}!well!oster

You should create a SIZE resource with an ID of 0, not -1.  -1 is created by
MultiFinder for YOUR PREFERRED size from the SIZE 0 resource.

-- 
-----------------------------------------------------------------------------
| Glenn L. Austin               | "Turn too soon, run out of room,          | 
| Auto Racing Enthusiast and    |   Turn too late, much better fate"        |
| Communications Toolbox Hacker |   - Jim Russell Racing School Instructors |
| Apple Computer, Inc.          | "Drive slower, race faster" - D. Waltrip  | 
| Internet:   austing@apple.com |-------------------------------------------|
| AppleLink:  AUSTIN.GLENN      | All opinions stated above are mine --     |
| Bellnet:    (408) 974-0876    |                who else would want them?  |
-----------------------------------------------------------------------------