Re: [PATCH 1/8] msi: use an array instead of a hashtable for WHEREVIEW
24 Aug
2011
24 Aug
'11
1:08 p.m.
Bernhard Loos <bernhardloos(a)googlemail.com> writes:
+static UINT add_row(MSIWHEREVIEW *wv, UINT val) { - MSIHASHENTRY *new = msi_alloc(sizeof(MSIHASHENTRY)); - MSIHASHENTRY *prev; + MSIROWENTRY *new; + + if (wv->reorder_size <= wv->row_count) + { + MSIROWENTRY **new_reorder; + UINT newsize = wv->reorder_size * 2; + + new_reorder = msi_alloc_zero(sizeof(MSIROWENTRY *) * newsize); + + if (!new_reorder) + return ERROR_OUTOFMEMORY; + + memcpy(new_reorder, wv->reorder, wv->row_count * sizeof(MSIROWENTRY *)); + msi_free(wv->reorder);
Any reason for not doing a realloc instead? -- Alexandre Julliard julliard(a)winehq.org
5229
Age (days ago)
5229
Last active (days ago)
0 comments
1 participants
participants (1)
-
Alexandre Julliard