• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Static data -- thanks
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Static data -- thanks


  • Subject: Re: Static data -- thanks
  • From: Eric Dahlman <email@hidden>
  • Date: Tue, 6 Jul 2004 10:31:41 -0500

On Jul 6, 2004, at 9:52 AM, Christopher Beck wrote:

  Interestingly, the
executable is huge (42MB).  The same code compiled with Visual studio
produces an executable that is 56KB.

If this is the case then what is happening is that Visual studio is recognizing that the static data is all zero and not actually placing it in the executable. The XCode version is so big because it includes 46 MB of zeros. Now I don't know if there is a way on Mach-O to perform a similar trick for "compressing" that zero data but there may well be. I think that using static memory for this is a bit of a design flaw though since obviously the data is not statically initialized. You should be dynamically allocating it on the heap with malloc or one of its brethren and referring to the memory through a static pointer if you really need the staticness. Programs that abuse static memory in the way that I suspect you are doing are unsatisfactory because they have a fixed upper bound on the size of the problem they can work on and they cannot efficiently process small data sets.


Just some thoughts,
-Eric
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Static data -- thanks
      • From: Allan Odgaard <email@hidden>
References: 
 >Re: Static data -- thanks (From: "Christopher Beck" <email@hidden>)

  • Prev by Date: Re: Static data -- thanks
  • Next by Date: re: Switch to Symbolic Counterpart keyboard equivalent
  • Previous by thread: Re: Static data -- thanks
  • Next by thread: Re: Static data -- thanks
  • Index(es):
    • Date
    • Thread