Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Is Objective-C Managed?

Is Objective-C Managed?
Thread Tools
TampaDeveloper
Dedicated MacNNer
Join Date: Nov 2003
Status: Offline
Reply With Quote
Dec 2, 2003, 11:15 PM
 
From what I understand, Objective-C is an extension of C, so I don't see how it could be "managed", but I have seen postings in newsgroups which refer to ObjC as the first managed language. So is there some managed-esque features of the language, or are the people in newsgroups smoking crack, as usual?
     
Angus_D
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Dec 3, 2003, 12:57 PM
 
What exactly do you mean by "managed"?
     
TampaDeveloper  (op)
Dedicated MacNNer
Join Date: Nov 2003
Status: Offline
Reply With Quote
Dec 3, 2003, 02:28 PM
 
Originally posted by Angus_D:
What exactly do you mean by "managed"?
Managed as in doesn't have direct access to memory. Examples include Java, C#, managed C++, vb.net.
     
Arkham_c
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status: Offline
Reply With Quote
Dec 3, 2003, 03:14 PM
 
Originally posted by TampaDeveloper:
Managed as in doesn't have direct access to memory. Examples include Java, C#, managed C++, vb.net.
Since Objective C is a derivitave of C, all C code is syntactically correct in ObjC. Therefore, you have full access to memory if you want it.

It's worth mentioning that you don't generally call malloc and free in ObjC. You send objects retain and release messages instead.
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
     
TampaDeveloper  (op)
Dedicated MacNNer
Join Date: Nov 2003
Status: Offline
Reply With Quote
Dec 3, 2003, 05:07 PM
 
Originally posted by Arkham_c:
Since Objective C is a derivitave of C, all C code is syntactically correct in ObjC. Therefore, you have full access to memory if you want it.

It's worth mentioning that you don't generally call malloc and free in ObjC. You send objects retain and release messages instead.
This probably answers my question. While not a managed language, per-se, ObjC protects one from buffer overruns, etc by following the design pattern you mention. Hmm, this seems like a good solution.

ObjC is officially the next language I'm going to learn.
     
Catfish_Man
Mac Elite
Join Date: Aug 2001
Status: Offline
Reply With Quote
Dec 4, 2003, 01:40 AM
 
Originally posted by TampaDeveloper:
This probably answers my question. While not a managed language, per-se, ObjC protects one from buffer overruns, etc by following the design pattern you mention. Hmm, this seems like a good solution.

ObjC is officially the next language I'm going to learn.
Good plan. It's really fun
     
Angus_D
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Dec 4, 2003, 04:04 PM
 
Originally posted by TampaDeveloper:
This probably answers my question. While not a managed language, per-se, ObjC protects one from buffer overruns, etc by following the design pattern you mention. Hmm, this seems like a good solution.
What you really mean is "does Objective-C have garbage collection" in which case the answer is no. Retain/release doesn't prevent you from buffer overruns, memory leaks, bad pointers or anything like that, it's just a structured method for memory management. You still have to do the memory management yourself.
     
flanders
Forum Regular
Join Date: Aug 2002
Location: Atlanta, GA, USA
Status: Offline
Reply With Quote
Dec 4, 2003, 04:47 PM
 
I think he's asking if Obj-C runs "in a box" like java or .net managed code that will govern resource access. It doesn't though, obj-c programs run in their own process space and have full access to system memory.
     
TampaDeveloper  (op)
Dedicated MacNNer
Join Date: Nov 2003
Status: Offline
Reply With Quote
Dec 6, 2003, 12:52 AM
 
Originally posted by flanders:
I think he's asking if Obj-C runs "in a box" like java or .net managed code that will govern resource access. It doesn't though, obj-c programs run in their own process space and have full access to system memory.
Thank you. This is what I was asking. Do you know of any good tools for identifying buffer-overruns, memory leaks, etc?
     
Catfish_Man
Mac Elite
Join Date: Aug 2001
Status: Offline
Reply With Quote
Dec 6, 2003, 01:09 AM
 
Originally posted by TampaDeveloper:
Thank you. This is what I was asking. Do you know of any good tools for identifying buffer-overruns, memory leaks, etc?
OmniObjectMeter is supposedly quite good for identifying leaks (omnigroup.com). I can't afford it, but I've had very good experiences with their other software.
     
Angus_D
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Dec 6, 2003, 07:19 PM
 
Originally posted by flanders:
I think he's asking if Obj-C runs "in a box" like java or .net managed code that will govern resource access. It doesn't though, obj-c programs run in their own process space and have full access to system memory.
Obj-C programs don't have "full access to system memory" because OS X has protected memory and separate address spaces for each process. The same applies to Java. Not really sure what you mean here... :???:
     
Chuckit
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Dec 6, 2003, 07:54 PM
 
Originally posted by Angus_D:
Obj-C programs don't have "full access to system memory" because OS X has protected memory and separate address spaces for each process. The same applies to Java. Not really sure what you mean here... :???:
I think he means the ability to directly access memory -- e.g. with malloc() -- rather than relying on a runtime to do it for you.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
larkost
Mac Elite
Join Date: Oct 1999
Location: San Jose, Ca
Status: Offline
Reply With Quote
Dec 17, 2003, 10:03 AM
 
Note: Obj-C does not protect you from buffer-overruns, but most of the Cocoa classes do. If you are using Cocoa network listeners, you are immune on that channel (unless you create the problem yourself in C), NSStrings are immune, etc...
     
   
Thread Tools
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 09:11 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,