Re: Xcode-users Digest, Vol 7, Issue 149
Re: Xcode-users Digest, Vol 7, Issue 149
- Subject: Re: Xcode-users Digest, Vol 7, Issue 149
- From: ouzi koskas <email@hidden>
- Date: Wed, 7 Apr 2010 15:41:32 +0200
Hi all,
Here is my problem.
I am writing, using C language, a software that read a lot of data on hard disk, but never the same data twice.
Snow leopard store in inactive memory all the data manipulated and released during computation, and when memory is full, started to swap, instead of using inactive memory.
Here is my question : Is there a function, in C language, that can, during computation and on demand, release inactive memory and make it free memory ?
because I am absolutely sure that the same data will never come back again, and inactive memory, in this particular case, will never be relevant.
Many thanks for your help.
Elie
Le 7 avr. 2010 à 15:25, email@hidden a écrit :
>
> Send Xcode-users mailing list submissions to
> email@hidden
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://lists.apple.com/mailman/listinfo/xcode-users
> or, via email, send a message with subject or body 'help' to
> email@hidden
>
> You can reach the person managing the list at
> email@hidden
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Xcode-users digest..."
>
>
> Today's Topics:
>
> 1. conditional settings based on architecture -- broken?
> (Andy O'Meara)
> 2. Re: conditional settings based on architecture -- broken?
> (Andy O'Meara)
> 3. Re: conditional settings based on architecture -- broken?
> (Chris Espinosa)
> 4. Re: conditional settings based on architecture -- broken?
> (Michael Rawdon)
> 5. Re: conditional settings based on architecture -- broken?
> (Andy O'Meara)
> 6. Re: conditional settings based on architecture -- broken?
> (Chris Espinosa)
> 7. Re: Xcode build settings (such as llvm-config) (Ken Thomases)
> 8. Re: Inline symbols visibility (Guillaume Billard)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 6 Apr 2010 14:28:37 -0500
> From: Andy O'Meara <email@hidden>
> Subject: conditional settings based on architecture -- broken?
> To: Apple xCode users <email@hidden>
> Message-ID: <email@hidden>
> Content-Type: text/plain; charset=us-ascii
>
>
> Hey Xcoders, quick question...
>
> I'm following the guidance of the following Apple Q&A on modifying an xcode project's project.pbxproj file without success:
>
> http://developer.apple.com/mac/library/qa/qa2009/qa1666.html
>
> Namely, adding 'GCC_ENABLE_OBJC_GC[sdk=macosx10.6][arch=x86_64] = required' causes xcode to error out when opening the project. I've tried all kinds of permutations with and without semi-colons without success. My guess is that this Q&A is outdated and that someone here can help.
>
> So if anyone can point me to docs discussing how to make various settings arch dependent I'd really appreciate it (as my searching has come up dry).
>
> Yes, I know I can set up multiple Xcode projects and merge the binaries via shell script but I'm looking for a low maintenance (and much less painful) solution.
>
> Thanks!
> Andy
>
>
>
> ------------------------------
>
> Message: 2
> Date: Tue, 6 Apr 2010 15:38:18 -0500
> From: Andy O'Meara <email@hidden>
> Subject: Re: conditional settings based on architecture -- broken?
> To: Apple xCode users <email@hidden>
> Message-ID: <email@hidden>
> Content-Type: text/plain; charset=us-ascii
>
>
> I've filed a radar -- 7833304
>
> Not very fun to be pouring major time into what is looking to be an Xcode issue.
>
>
> On Apr 6, 2010, at 2:28 PM, Andy O'Meara wrote:
>
>>
>> Hey Xcoders, quick question...
>>
>> I'm following the guidance of the following Apple Q&A on modifying an xcode project's project.pbxproj file without success:
>>
>> http://developer.apple.com/mac/library/qa/qa2009/qa1666.html
>>
>> Namely, adding 'GCC_ENABLE_OBJC_GC[sdk=macosx10.6][arch=x86_64] = required' causes xcode to error out when opening the project. I've tried all kinds of permutations with and without semi-colons without success. My guess is that this Q&A is outdated and that someone here can help.
>>
>> So if anyone can point me to docs discussing how to make various settings arch dependent I'd really appreciate it (as my searching has come up dry).
>>
>> Yes, I know I can set up multiple Xcode projects and merge the binaries via shell script but I'm looking for a low maintenance (and much less painful) solution.
>>
>> Thanks!
>> Andy
>>
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Xcode-users mailing list (email@hidden)
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to email@hidden
>
>
>
> ------------------------------
>
> Message: 3
> Date: Tue, 6 Apr 2010 14:20:17 -0700
> From: Chris Espinosa <email@hidden>
> Subject: Re: conditional settings based on architecture -- broken?
> To: Andy O'Meara <email@hidden>
> Cc: Apple xCode users <email@hidden>
> Message-ID: <email@hidden>
> Content-Type: text/plain; charset="us-ascii"
>
>
> On Apr 6, 2010, at 1:38 PM, Andy O'Meara wrote:
>
>>> Hey Xcoders, quick question...
>>>
>>> I'm following the guidance of the following Apple Q&A on modifying an xcode project's project.pbxproj file without success:
>>>
>>> http://developer.apple.com/mac/library/qa/qa2009/qa1666.html
>>>
>>> Namely, adding 'GCC_ENABLE_OBJC_GC[sdk=macosx10.6][arch=x86_64] = required' causes xcode to error out when opening the project. I've tried all kinds of permutations with and without semi-colons without success. My guess is that this Q&A is outdated and that someone here can help.
>>>
>>> So if anyone can point me to docs discussing how to make various settings arch dependent I'd really appreciate it (as my searching has come up dry).
>>>
>>> Yes, I know I can set up multiple Xcode projects and merge the binaries via shell script but I'm looking for a low maintenance (and much less painful) solution.
>>
>
> Why are you hand-editing the project file at all?
>
> You can paste that text into the Build Settings panel itself and Xcode will do its job of saving it in the project file for you. That's what the technote says: use copy and paste.
>
> Chris
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://lists.apple.com/pipermail/xcode-users/attachments/20100406/d96b251d/attachment.html
>
> ------------------------------
>
> Message: 4
> Date: Tue, 6 Apr 2010 14:37:37 -0700
> From: Michael Rawdon <email@hidden>
> Subject: Re: conditional settings based on architecture -- broken?
> To: Andy O'Meara <email@hidden>
> Cc: Apple xCode users <email@hidden>
> Message-ID: <email@hidden>
> Content-Type: text/plain; charset="us-ascii"
>
> On Apr 6, 2010, at 2:20 PM, Chris Espinosa wrote:
>> On Apr 6, 2010, at 1:38 PM, Andy O'Meara wrote:
>>>> Hey Xcoders, quick question...
>>>>
>>>> I'm following the guidance of the following Apple Q&A on modifying an xcode project's project.pbxproj file without success:
>>>>
>>>> http://developer.apple.com/mac/library/qa/qa2009/qa1666.html
>>>>
>>>> Namely, adding 'GCC_ENABLE_OBJC_GC[sdk=macosx10.6][arch=x86_64] = required' causes xcode to error out when opening the project. I've tried all kinds of permutations with and without semi-colons without success. My guess is that this Q&A is outdated and that someone here can help.
>>>>
>>>> So if anyone can point me to docs discussing how to make various settings arch dependent I'd really appreciate it (as my searching has come up dry).
>>>>
>>>> Yes, I know I can set up multiple Xcode projects and merge the binaries via shell script but I'm looking for a low maintenance (and much less painful) solution.
>>>
>>
>> Why are you hand-editing the project file at all?
>>
>> You can paste that text into the Build Settings panel itself and Xcode will do its job of saving it in the project file for you. That's what the technote says: use copy and paste.
>
> Alternately you can use the "gear" popup menu in the build settings inspector to add the condition manually.
>
> But yes, editing the project file directly is not generally recommended. In this specific case, you need to quote the left-hand-side of the assignment for the plist parser to properly parse the project file. But it's easier to go through the GUI.
>
> --
> Michael Rawdon
> email@hidden
> Xcode Developer
> Apple Inc., Cupertino CA
>
>
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://lists.apple.com/pipermail/xcode-users/attachments/20100406/8e1f369e/attachment.html
>
> ------------------------------
>
> Message: 5
> Date: Tue, 6 Apr 2010 16:42:17 -0500
> From: Andy O'Meara <email@hidden>
> Subject: Re: conditional settings based on architecture -- broken?
> To: Apple xCode users <email@hidden>
> Message-ID: <email@hidden>
> Content-Type: text/plain; charset=us-ascii
>
>
> Ah, thanks Chris -- that was it!
>
> FYI, I've updated my file radar:
>
> /////
>
> When the Q&A says "the above can be cut-and-pasted...", it means it should be pasted into the project's build settings *window* not the project file (project.pbxproj). Upon doing this, it's now clear the parse problem was because lvalues in the project.pbxproj file with a conditional suffix need to be in quotes.
>
> This would have been noticeable, but in the 'Xcode Build System Guide' in the 'Conditional Build Settings' section, there is *no* mention of the above.
>
> Suggestion action:
>
> Augment the content in the 'Conditional Build Settings' section to say that (a) conditional items need to be in double quotes if the project.pbxproj file is edited and (b) conditional settings should normally be inserted by pasting into the settings *window*, not the project.pbxproj file.
>
> /////
>
>
> On Apr 6, 2010, at 4:20 PM, Chris Espinosa wrote:
>
>>
>> On Apr 6, 2010, at 1:38 PM, Andy O'Meara wrote:
>>
>>>> Hey Xcoders, quick question...
>>>>
>>>> I'm following the guidance of the following Apple Q&A on modifying an xcode project's project.pbxproj file without success:
>>>>
>>>> http://developer.apple.com/mac/library/qa/qa2009/qa1666.html
>>>>
>>>> Namely, adding 'GCC_ENABLE_OBJC_GC[sdk=macosx10.6][arch=x86_64] = required' causes xcode to error out when opening the project. I've tried all kinds of permutations with and without semi-colons without success. My guess is that this Q&A is outdated and that someone here can help.
>>>>
>>>> So if anyone can point me to docs discussing how to make various settings arch dependent I'd really appreciate it (as my searching has come up dry).
>>>>
>>>> Yes, I know I can set up multiple Xcode projects and merge the binaries via shell script but I'm looking for a low maintenance (and much less painful) solution.
>>>
>>
>> Why are you hand-editing the project file at all?
>>
>> You can paste that text into the Build Settings panel itself and Xcode will do its job of saving it in the project file for you. That's what the technote says: use copy and paste.
>>
>> Chris
>
>
>
> ------------------------------
>
> Message: 6
> Date: Tue, 6 Apr 2010 15:39:47 -0700
> From: Chris Espinosa <email@hidden>
> Subject: Re: conditional settings based on architecture -- broken?
> To: Andy O'Meara <email@hidden>
> Cc: Apple xCode users <email@hidden>
> Message-ID: <email@hidden>
> Content-Type: text/plain; charset=us-ascii
>
>
> On Apr 6, 2010, at 2:42 PM, Andy O'Meara wrote:
>
>> This would have been noticeable, but in the 'Xcode Build System Guide' in the 'Conditional Build Settings' section, there is *no* mention of the above.
>
> That's because the Xcode project file format is private and undocumented, and there's no expectation in documentation, user interface, or tech notes that you would ever hand-edit it. I don't see the problem here other than that you didn't expect Xcode to behave correctly (by supporting Copy and Paste in the UI, rather than having to hand-edit the project file), and in this case it does :-)
>
> Chris
>
> ------------------------------
>
> Message: 7
> Date: Wed, 7 Apr 2010 01:58:16 -0500
> From: Ken Thomases <email@hidden>
> Subject: Re: Xcode build settings (such as llvm-config)
> To: Samuel Williams <email@hidden>
> Cc: xcode-users list <email@hidden>
> Message-ID: <email@hidden>
> Content-Type: text/plain; charset=us-ascii
>
> I have redirected this to the Xcode-users list, since that's where it belongs. This has nothing to do with Cocoa.
>
> On Apr 7, 2010, at 12:26 AM, Samuel Williams wrote:
>
>> I want to execute a command to get a list of libraries for inclusion into my application
>>
>> llvm-config --libs
>>
>> Gives me: -lLLVMXCoreCodeGen -lLLVMXCoreAsmPrinter -lLLVMXCoreInfo -lLLVMSystemZCodeGen -lLLVMSystemZAsmPrinter -lLLVMSystemZInfo [snip]
>>
>> Normally it is used such as
>>
>> export LDFLAGS=`llvm-config --libs`
>>
>> or
>>
>> g++ `llvm-config --libs --cflags`
>>
>> I tried putting this in a Run Script build phase but it didn't work. I also couldn't figure out how to put this into the Build Settings.
>
> You've tried putting what, _exactly_, in a Run Script build phase? And in what way didn't it work? What result did you get and how did that differ from what you expected to get?
>
> Is llvm-config in the default PATH? Note that the environment variables, including PATH, you might see in a shell in a Terminal window is not really related at all to the environment variables for a process launched from the Finder or Dock.
>
> Regards,
> Ken
>
>
>
> ------------------------------
>
> Message: 8
> Date: Wed, 7 Apr 2010 15:23:14 +0200
> From: Guillaume Billard <email@hidden>
> Subject: Re: Inline symbols visibility
> To: xcode-Users List <email@hidden>
> Message-ID: <email@hidden>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Le 2 avr. 2010 à 19:10, Andreas Grosam a écrit :
>
>> You should be carefully, though with static declared member variables which may be accessed in inline member functions. The static member variable shall be visible, and all copies of an inline member function shall access this single instance. Usually, the compiler and linker takes care about all of this - but not always (see one of my previous post).
>
> I checked, the inline function indeed accesses a static member variable (through a static member function). I would say that this static member variable is indeed visible, but how do I check that all copies of the inline member function do access this single instance? I'm not sure I understand.
> Actually I'm not even sure what a "out-of-line copy of an inline member function" is, sorry. I've read the term many times but I'm still confused.
>
>>> I found this thread where it seems that the same behavior occurred:
>>> http://lists.apple.com/archives/xcode-users/2005/Jul/msg00609.html.
>>>
>>> Adding the "default" visibility attribute to the inline method solved the problem.
>>> If I'm not mistaken, the compiler gets to decide wether to inline methods or not, even when they're defined out of their class definition.
>>> It appears that it can inline methods for classes that use __attribute__((visibility("default"))), but I don't know if it can do the same for out-of-class methods. I'm hoping not.
>>> I'd like to know if adding the attribute to a method of a visible class whenever it doesn't get exported is the right approach.
>> Actually, it will be *exported* , the function is in your header. Unless its declared private in the class, clients have "access" to it. Do you mismatch interfaces and visibility?
>
> I don't mismatch the two but it's true, now that you make me think about it, how come this function would not be available? I want to believe you that it's not about visibility, but still adding the visibility attribute fixes my problem.
> Below is a simplification of the code I'm working with. I'm sorry I don't have a reproducible sample.
>
> ************************************************************************************
>
> // ---------------------------------------------------------------------------------------------------------------------
> // gnReplicationDatagram.h, part of a mid-level dynamic library
>
> #include "<path_to_low_level_library>/gnMetaClass.h"
>
> class __attribute__((visibility("default"))) gnReplicationDatagram
> {
> private:
> static gnMetaClass const* ms_pClass_gnReplicationDatagram;
>
> public:
> static gnMetaClass const& MetaClass()
> {
> return *ms_pClass_gnReplicationDatagram;
> }
>
> /*__attribute__((visibility("default")))*/ virtual gnMetaClass const& GetMetaClass() const
> {
> return gnReplicationDatagram::MetaClass();
> }
>
> public:
> gnReplicationDatagram() {}
> virtual ~gnReplicationDatagram() {}
>
> gnReplicationDatagram(gnReplicationDatagramId a_eId): m_eId(a_eId) {}
>
> private:
> gnReplicationDatagramId m_eId;
> };
>
>
> // ---------------------------------------------------------------------------------------------------------------------
> // gnReplicationObjectsCreationDatagram.h, part of the same mid-level dynamic library as above
>
> #include "<path_to_mid_level_library>/gnReplicationDatagram.h"
>
> class __attribute__((visibility("default"))) gnReplicationObjectsCreationDatagram: public gnReplicationDatagram, gnNoCopy<gnReplicationObjectsCreationDatagram>
> {
> private:
> static gnMetaClass const* ms_pClass_gnReplicationObjectsCreationDatagram;
>
> public:
> static gnMetaClass const& MetaClass()
> {
> return *ms_pClass_gnReplicationObjectsCreationDatagram;
> }
>
> /*__attribute__((visibility("default")))*/ virtual gnMetaClass const& GetMetaClass() const
> {
> return gnReplicationObjectsCreationDatagram::MetaClass();
> }
>
> public:
> gnReplicationObjectsCreationDatagram(): gnReplicationDatagram(gnReplicationDatagramId::eObjectCreation) {}
> virtual ~gnReplicationObjectsCreationDatagram();
>
> private:
> // some non-static variable
> };
>
>
> // ---------------------------------------------------------------------------------------------------------------------
> // gnReplicationDatagramUTestSuite.cpp, part of a Unit Test dynamic library
>
> #include "<path_to_mid_level_library>/gnReplicationObjectsCreationDatagram.h"
>
> class gnReplicationDatagramUTestSuite: public gnUTestSuite
> {
> private:
> void ObjectsCreationDestructionDatagram()
> {
> gnReplicationObjectsCreationDatagram oCreationDatagram;
> }
> };
>
> ************************************************************************************
>
> Enabling the 2 commented attributes fixes the link error that I have when I build the Unit Test library with -03 instead of -O0 or -Os:
> Undefined symbols:
> "gnReplicationObjectsCreationDatagram::GetMetaClass() const", referenced from:
> gnReplicationDatagramUTestSuite::ObjectsCreationDestructionDatagram() in gnReplicationDatagramUTestSuite.o
>
> If that helps, using nm on the mid-level library I see this line:
> 001a9c30 t __ZNK36gnReplicationObjectsCreationDatagram12GetMetaClassEv
> Which c++filt sees as:
> gnReplicationObjectsCreationDatagram::GetMetaClass() const
>
>
> To put things into context, the pieces of code about gnMetaClass that are almost identical in the 2 classes actually are an expanded macro defined in the low-level library, used to implement reflexivity.
>
> Thanks a lot for your detailed answer, I hope this piece of code can help you helping me understand this! :)
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://lists.apple.com/pipermail/xcode-users/attachments/20100407/fa10247f/attachment.html
>
> ------------------------------
>
> _______________________________________________
> Xcode-users mailing list
> email@hidden
> http://lists.apple.com/mailman/listinfo/xcode-users
>
> End of Xcode-users Digest, Vol 7, Issue 149
> *******************************************
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden