discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: objc-runtime - methodLists not in Class


From: David Ayers
Subject: Re: objc-runtime - methodLists not in Class
Date: Mon, 12 May 2003 17:34:46 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030312

Tobias wrote:

in 'obc-class' definition, there is a field, which is defined as

struct objc_method_list** methodLists;


see [1] for reference

do we have something similar, or do i have to create a function to do this?
That depends on who you mean by "we" :-)

The ObjC Runtime is part of the compiler libraries. But, yes, the FSF GCC's ObjC Runtime has a corresponding stucture member:
struct objc_method_list*  methods;
found in:
objc/objc.h
see:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libobjc/objc/objc.h?rev=1.3&content-type=text/x-cvsweb-markup
it is a linked list rather than an array of pointers.

Unfortunately the NeXT/Apple and FSF ObjC Runtimes have multiple subtile differences. gnustep/base/objc-gnu2next.h attempts to do some runtime mappings but does the wrong thing for some mappings, which just aren't as simple as redefine. (see: class_get_class_method/class_getClassMethod)

That's why gnustep has GSObjCRuntime.h/.m, which can abstract the runtime API much better. I'm actually fiddeling with a local version trying to create an API for method manipulations. At the same time I'm adapting some of the existing implementations to avoid ObjC code with in these functions, to make them usable at a time where the ObjC isn't ready to be used yet (i.e. during +load) (Note: Please don't write anything that makes use of the GSObjCReplaceMethod function, I introduced a bit back. It's a hack I'd like to revert, once I have more coherent solution.)

Maybe you could explain a bit more what it is you want to do and I could see if I could post an RFA for the bits I've got, if the help solve your problem, because I'm still to far from posting an RFA for all the tweaks I'm fiddeling with.

Cheers,
Dave






reply via email to

[Prev in Thread] Current Thread [Next in Thread]