Another attempt to work with non-fragile abi

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38838 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2015-07-24 19:59:05 +00:00
parent d4234288d5
commit 14d22790b6
4 changed files with 18 additions and 5 deletions

View file

@ -1,3 +1,10 @@
2015-07-24 Richard Frith-Macdonald <rfm@gnu.org>
* Headers/GNUstepBase/GSIMap.h: add GSI_MAP_TABLE_S
* Source/NSConcreteHashTable.m:
* Source/NSConcreteMapTable.m:
Pass variable holding run time size calculation as GSI_MAP_TABLE_S
2015-07-22 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSConcreteHashTable.m:

View file

@ -378,6 +378,10 @@ struct _GSIMapTable {
#define GSI_MAP_TABLE_T GSIMapTable_t
#endif
#ifndef GSI_MAP_TABLE_S
#define GSI_MAP_TABLE_S sizeof(GSI_MAP_TABLE_T)
#endif
typedef struct _GSIMapEnumerator {
GSIMapTable map; /* the map being enumerated. */
GSIMapNode node; /* The next node to use. */
@ -1269,7 +1273,7 @@ GSIMapSize(GSIMapTable map)
/* Map table plus arrays of pointers to chunks
*/
size = sizeof(GSI_MAP_TABLE_T) + map->chunkCount * sizeof(void*);
size = GSI_MAP_TABLE_S + map->chunkCount * sizeof(void*);
/* Add the array of buckets.
*/

View file

@ -41,6 +41,8 @@
#import "GSPrivate.h"
static Class concreteClass = Nil;
static unsigned instanceSize = 0;
/* Here is the interface for the concrete class as used by the functions.
*/
@ -73,6 +75,7 @@ typedef GSIMapNode_t *GSIMapNode;
#define GSI_MAP_HAS_VALUE 0
#define GSI_MAP_KTYPES GSUNION_PTR | GSUNION_OBJ
#define GSI_MAP_TABLE_T NSConcreteHashTable
#define GSI_MAP_TABLE_S instanceSize
#define GSI_MAP_HASH(M, X)\
(M->legacy ? M->cb.old.hash(M, X.ptr) \
@ -827,8 +830,6 @@ const NSHashTableCallBacks NSPointerToStructHashCallBacks =
@implementation NSConcreteHashTable
static unsigned instanceSize = 0;
+ (void) initialize
{
if (concreteClass == Nil)

View file

@ -40,6 +40,8 @@
#import "NSCallBacks.h"
static Class concreteClass = Nil;
static unsigned instanceSize = 0;
/* Here is the interface for the concrete class as used by the functions.
*/
@ -76,6 +78,7 @@ typedef GSIMapNode_t *GSIMapNode;
@end
#define GSI_MAP_TABLE_T NSConcreteMapTable
#define GSI_MAP_TABLE_S instanceSize
#define GSI_MAP_KTYPES GSUNION_PTR | GSUNION_OBJ
#define GSI_MAP_VTYPES GSUNION_PTR | GSUNION_OBJ
@ -1185,8 +1188,6 @@ const NSMapTableValueCallBacks NSOwnedPointerMapValueCallBacks =
@implementation NSConcreteMapTable
static unsigned instanceSize = 0;
+ (void) initialize
{
if (concreteClass == Nil)