Mercurial > pidgin.yaz
comparison libpurple/protocols/oscar/family_oservice.c @ 29329:4d50162d809e
Put all our rateclass members in a single hash table instead of in one
hash table per rateclass. Should reduce memory usage by using 1 hash
table instead of 5ish for each flap connection
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Wed, 03 Feb 2010 01:03:09 +0000 |
parents | 2e3e0801de29 |
children | ad4960c2df28 |
comparison
equal
deleted
inserted
replaced
29328:0616027add19 | 29329:4d50162d809e |
---|---|
360 } | 360 } |
361 | 361 |
362 rateclass->last.tv_sec = now.tv_sec - delta / 1000; | 362 rateclass->last.tv_sec = now.tv_sec - delta / 1000; |
363 rateclass->last.tv_usec = now.tv_usec - (delta % 1000) * 1000; | 363 rateclass->last.tv_usec = now.tv_usec - (delta % 1000) * 1000; |
364 | 364 |
365 rateclass->members = g_hash_table_new(g_direct_hash, g_direct_equal); | |
366 conn->rateclasses = g_slist_prepend(conn->rateclasses, rateclass); | 365 conn->rateclasses = g_slist_prepend(conn->rateclasses, rateclass); |
367 | 366 |
368 if (rateclass->classid == OSCAR_DEFAULT_RATECLASS) | 367 if (rateclass->classid == OSCAR_DEFAULT_RATECLASS) |
369 conn->default_rateclass = rateclass; | 368 conn->default_rateclass = rateclass; |
370 } | 369 } |
399 | 398 |
400 group = byte_stream_get16(bs); | 399 group = byte_stream_get16(bs); |
401 subtype = byte_stream_get16(bs); | 400 subtype = byte_stream_get16(bs); |
402 | 401 |
403 if (rateclass != NULL) | 402 if (rateclass != NULL) |
404 g_hash_table_insert(rateclass->members, | 403 g_hash_table_insert(conn->rateclass_members, |
405 GUINT_TO_POINTER((group << 16) + subtype), | 404 GUINT_TO_POINTER((group << 16) + subtype), |
406 GUINT_TO_POINTER(TRUE)); | 405 rateclass); |
407 } | 406 } |
408 } | 407 } |
409 | 408 |
410 /* | 409 /* |
411 * We don't pass the rate information up to the client, as it really | 410 * We don't pass the rate information up to the client, as it really |