Author: fireball Date: Fri Jul 24 23:33:28 2009 New Revision: 42184
URL: http://svn.reactos.org/svn/reactos?rev=42184&view=rev Log: - Implement shrink_handle_table though this code (along with the object.c) will be deprecated in future.
Modified: branches/arwinss/reactos/subsystems/win32/win32k/wine/handle.c
Modified: branches/arwinss/reactos/subsystems/win32/win32k/wine/handle.c URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win32... ============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/wine/handle.c [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/wine/handle.c [iso-8859-1] Fri Jul 24 23:33:28 2009 @@ -300,10 +300,10 @@ /* attempt to shrink a table */ static void shrink_handle_table( struct handle_table *table ) { -#if 0 struct handle_entry *entry = table->entries + table->last; struct handle_entry *new_entries; int count = table->count; + int count_old = table->count;
while (table->last >= 0) { @@ -314,12 +314,10 @@ if (table->last >= count / 4) return; /* no need to shrink */ if (count < MIN_HANDLE_ENTRIES * 2) return; /* too small to shrink */ count /= 2; - if (!(new_entries = realloc( table->entries, count * sizeof(*new_entries) ))) return; + if (!(new_entries = + ExReallocPool( table->entries, count * sizeof(*new_entries), count_old * sizeof(*new_entries) ))) return; table->count = count; table->entries = new_entries; -#else - UNIMPLEMENTED; -#endif }
/* copy the handle table of the parent process */