bug-gnustep
[Top][All Lists]
Advanced

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

Re: base (mingw): NSObjCRuntime.m, NSGetSizeAndAlignment


From: Ovidiu Predescu
Subject: Re: base (mingw): NSObjCRuntime.m, NSGetSizeAndAlignment
Date: 23 Apr 2001 09:48:13 -0700

On Mon, 23 Apr 2001 12:49:40 +0100, Richard Frith-Macdonald <address@hidden> 
wrote:

> 
> On Thursday, April 19, 2001, at 01:41 PM, Michael Scheibler wrote:
> 
> > The code delivers wrong results for sizep. Could the reason be that 
> > there is
> > no special mframe implementation for win32?
> >
> > const char *
> > NSGetSizeAndAlignment(const char *typePtr, unsigned *sizep, unsigned
> > *alignp)
> > {
> >   NSArgumentInfo info;
> >   typePtr = mframe_next_arg(typePtr, &info);
> >   if (sizep)
> >     *sizep = info.size;
> >   if (alignp)
> >     *alignp = info.align;
> >   return typePtr;
> > }
> >
> >
> >
> >
> > When I use the original objc-runtime implementations it runs. Why did 
> > you
> > use mframe instead?
> 
> At the time ... to work round bugs in the libobjc code ... and to ensure 
> that
> any bugs in the mframe code were exposed as quickly as possible.

If you found any bugs in the libobjc code, please report them on the
address@hidden It is helpful to know about these bugs so we can
fix them in the future versions of the compiler.

> Also, because calling the libobjc code with illegal arguments causes a 
> crash.
> 
> It would be nice to update the mframe code to -
> 1. handle simple types directly and cope with illegal types.
> 2. use libobjc to obtain info for more complex types.

The code in libobjc that handles size and alignment is complex and
tries to follow the some algorithm the compiler itself uses. Be aware
that the old API of accessing the size and alignment is not always
correct, and the preferred way to do this is to use the new functions
provided by the runtime.


Regards,
-- 
Ovidiu Predescu <address@hidden>
http://orion.nsr.hp.com/ (inside HP's firewall only)
http://www.geocities.com/SiliconValley/Monitor/7464/ (GNU, Emacs, other stuff)

Did you miss my presentation, "Using Cocoon to build Web sites for
wireless devices" at ApacheCon 2001 in Santa Clara, CA? You can still
get my presentation on the Web at:
http://www.geocities.com/SiliconValley/Monitor/7464/apachecon-2001/



reply via email to

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