Message ID | 1298898537.48212483@www2.webmail.us |
---|---|
State | New |
Headers | show |
On 28.02.2011 14:08, Nicola Pero wrote: > It would be good to > add these in 4.7 (hopefully at the same time we should also make the change to install > properly the GC library when GC is enabled!). ;-) why? it's built as a convenience library, and the object files are linked into libobjc_gc.
>> add these in 4.7 (hopefully at the same time we should also make the change to install >> properly the GC library when GC is enabled!). ;-) > > why? it's built as a convenience library, and the object files are linked into > libobjc_gc. I had a problem with gnustep-base requiring the header gc/gc.h, which is not installed when I install GCC. The reason it requires it seems to be that the new trend is gnustep-base not using objc_malloc(), but calling the GC library directly. Higher-level libraries then use NSAllocateCollectable() & friends to allocate memory, which is provided by gnustep-base. Let me know if I'm missing something. ;-) Thanks
On 01.03.2011 01:40, Nicola Pero wrote: > >>> add these in 4.7 (hopefully at the same time we should also make the change to install >>> properly the GC library when GC is enabled!). ;-) >> >> why? it's built as a convenience library, and the object files are linked into >> libobjc_gc. > > I had a problem with gnustep-base requiring the header gc/gc.h, which is not installed when I install > GCC. The reason it requires it seems to be that the new trend is gnustep-base not using objc_malloc(), > but calling the GC library directly. Higher-level libraries then use NSAllocateCollectable() & friends > to allocate memory, which is provided by gnustep-base. > > Let me know if I'm missing something. ;-) the other boehm-gc user in GCC is libjava, which doesn't require an installed gc header. Would it be sensible (if libobjc_gc is enabled) to install this header in <gcc_lib_dir>/include/objc, so that it can be included as <objc/gc.h>? That way it wouldn't conflict with headers installed by a system wide libgc. Matthias
Index: ChangeLog =================================================================== --- ChangeLog (revision 170559) +++ ChangeLog (working copy) @@ -1,3 +1,9 @@ +2011-02-28 Richard Frith-Macdonald <rfm@gnu.org> + + PR libobjc/47922 + * gc.c (class_ivar_set_gcinvisible): Use _C_GCINVISIBLE instead of + a hardcoded "!". + 2011-02-13 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> * configure: Regenerate. Index: gc.c =================================================================== --- gc.c (revision 170559) +++ gc.c (working copy) @@ -422,11 +422,15 @@ /* The variable is gc visible so we make it gc_invisible. */ new_type = objc_malloc (strlen(ivar->ivar_type) + 2); + + /* Copy the variable name. */ len = (type - ivar->ivar_type); memcpy (new_type, ivar->ivar_type, len); - new_type[len] = 0; - strcat (new_type, "!"); - strcat (new_type, type); + /* Add '!'. */ + new_type[len++] = _C_GCINVISIBLE; + /* Copy the original types. */ + strcpy (new_type + len, type); + ivar->ivar_type = new_type; }