A couple of small bug fixes.

main
theraven 14 years ago
parent abff244ef9
commit 6950cb8e55

@ -163,35 +163,6 @@ static int PREFIX(_table_resize)(PREFIX(_table) *table)
}
#else
# if !(defined(MAP_TABLE_SINGLE_THREAD) || defined(ENABLE_GC))
// Collects garbage in the background
void objc_collect_garbage_data(void(*)(void*), void*);
/**
* Free the memory from an old table. By the time that this is reached, there
* are no heap pointers pointing to this table. There may be iterators, in
* which case we push this cleanup to the back of the queue and try it again
* later. Alternatively, there may be some lookups in progress. These all
* take a maximum of 32 hash lookups to complete. The time taken for the hash
* function, however, is not deterministic. To be on the safe side, we
* calculate the hash of every single element in the table before freeing it.
*/
static void PREFIX(_table_collect_garbage)(void *t)
{
PREFIX(_table) *table = t;
usleep(5000);
// If there are outstanding enumerators on this table, try again later.
if (table->enumerator_count > 0)
{
objc_collect_garbage_data(PREFIX(_table_collect_garbage), t);
return;
}
sleep(30);
free(table->table);
free(table);
}
# endif
static int PREFIX(_insert)(PREFIX(_table) *table, MAP_TABLE_VALUE_TYPE value);
static int PREFIX(_table_resize)(PREFIX(_table) *table)
@ -225,13 +196,10 @@ static int PREFIX(_table_resize)(PREFIX(_table) *table)
PREFIX(_insert)(table, value);
}
}
__sync_synchronize();
table->old = NULL;
# ifndef ENABLE_GC
# ifdef MAP_TABLE_SINGLE_THREAD
# if !defined(ENABLE_GC) && defined(MAP_TABLE_SINGLE_THREAD)
free(copy);
# else
objc_collect_garbage_data(PREFIX(_table_collect_garbage), copy);
# endif
# endif
return 1;
}

@ -24,7 +24,7 @@ static Slot_t objc_msg_forward3_null(id receiver, SEL op) { return &nil_slot; }
id (*objc_proxy_lookup)(id receiver, SEL op) = objc_proxy_lookup_null;
Slot_t (*__objc_msg_forward3)(id receiver, SEL op) = objc_msg_forward3_null;
#ifdef NO_SELECTOR_MISMATCH_WARNINGS
#ifndef NO_SELECTOR_MISMATCH_WARNINGS
static struct objc_slot* objc_selector_type_mismatch(Class cls, SEL
selector, Slot_t result)
{

Loading…
Cancel
Save