X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=lib%2Fsilcutil%2Fsilcdlist.h;h=5b7a6ab69dfda2010bb88fd607ad956743959003;hb=d130c376d5e2475fc3cbf30b9fe70d6274f4b7ea;hp=cb46c82f303b825bb9202ef7ae03c3d002bb2dbb;hpb=97ca3ffe0ce65ac0c5fa3274284825537e996c78;p=silc.git diff --git a/lib/silcutil/silcdlist.h b/lib/silcutil/silcdlist.h index cb46c82f..5b7a6ab6 100644 --- a/lib/silcutil/silcdlist.h +++ b/lib/silcutil/silcdlist.h @@ -4,7 +4,7 @@ Author: Pekka Riikonen - Copyright (C) 2000 - 2005 Pekka Riikonen + Copyright (C) 2000 - 2006 Pekka Riikonen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -30,10 +30,10 @@ * will automatically allocate list entries. Normal SILC List API cannot * be used for this purpose because in that case the context passed to the * list must be defined as list structure already. This is not the case in - * SilcDList. But SilcDList is a bit slower than SilcList because it + * SilcDList. But SilcDList is a bit slower than SilcList because it * requires memory allocation when adding new entries to the list. * - * SILC Dynamic List is not thread-safe. If the same list context must be + * SILC Dynamic List is not thread-safe. If the same list context must be * used in multithreaded environment concurrency control must be employed. * ***/ @@ -201,7 +201,7 @@ static inline SilcBool silc_dlist_add(SilcDList list, void *context) { SilcDListEntry e = (SilcDListEntry)silc_malloc(sizeof(*e)); - if (!e) + if (silc_unlikely(!e)) return FALSE; e->context = context; silc_list_add(list->list, e); @@ -227,7 +227,7 @@ static inline SilcBool silc_dlist_insert(SilcDList list, void *context) { SilcDListEntry e = (SilcDListEntry)silc_malloc(sizeof(*e)); - if (!e) + if (silc_unlikely(!e)) return FALSE; e->context = context; silc_list_insert(list->list, list->prev, e);