Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(524)

Side by Side Diff: nss/lib/base/hashops.c

Issue 1843333003: Update NSPR to 4.12 and NSS to 3.23 on iOS (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/nss.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* This Source Code Form is subject to the terms of the Mozilla Public 1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this 2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4 4
5 /* 5 /*
6 * hashops.c 6 * hashops.c
7 * 7 *
8 * This file includes a set of PLHashAllocOps that use NSSArenas. 8 * This file includes a set of PLHashAllocOps that use NSSArenas.
9 */ 9 */
10 10
11 #ifndef BASE_H 11 #ifndef BASE_H
12 #include "base.h" 12 #include "base.h"
13 #endif /* BASE_H */ 13 #endif /* BASE_H */
14 14
15 static void * PR_CALLBACK 15 static void *PR_CALLBACK
16 nss_arena_hash_alloc_table 16 nss_arena_hash_alloc_table(void *pool, PRSize size)
17 (
18 void *pool,
19 PRSize size
20 )
21 { 17 {
22 NSSArena *arena = (NSSArena *)NULL; 18 NSSArena *arena = (NSSArena *)NULL;
23 19
24 #ifdef NSSDEBUG 20 #ifdef NSSDEBUG
25 if( (void *)NULL != arena ) { 21 if ((void *)NULL != arena) {
26 if( PR_SUCCESS != nssArena_verifyPointer(arena) ) { 22 if (PR_SUCCESS != nssArena_verifyPointer(arena)) {
27 return (void *)NULL; 23 return (void *)NULL;
24 }
28 } 25 }
29 }
30 #endif /* NSSDEBUG */ 26 #endif /* NSSDEBUG */
31 27
32 return nss_ZAlloc(arena, size); 28 return nss_ZAlloc(arena, size);
33 } 29 }
34 30
35 static void PR_CALLBACK 31 static void PR_CALLBACK
36 nss_arena_hash_free_table 32 nss_arena_hash_free_table(void *pool, void *item)
37 (
38 void *pool,
39 void *item
40 )
41 { 33 {
42 (void)nss_ZFreeIf(item); 34 (void)nss_ZFreeIf(item);
43 } 35 }
44 36
45 static PLHashEntry * PR_CALLBACK 37 static PLHashEntry *PR_CALLBACK
46 nss_arena_hash_alloc_entry 38 nss_arena_hash_alloc_entry(void *pool, const void *key)
47 (
48 void *pool,
49 const void *key
50 )
51 { 39 {
52 NSSArena *arena = NULL; 40 NSSArena *arena = NULL;
53 41
54 #ifdef NSSDEBUG 42 #ifdef NSSDEBUG
55 if( (void *)NULL != arena ) { 43 if ((void *)NULL != arena) {
56 if( PR_SUCCESS != nssArena_verifyPointer(arena) ) { 44 if (PR_SUCCESS != nssArena_verifyPointer(arena)) {
57 return (void *)NULL; 45 return (void *)NULL;
46 }
58 } 47 }
59 }
60 #endif /* NSSDEBUG */ 48 #endif /* NSSDEBUG */
61 49
62 return nss_ZNEW(arena, PLHashEntry); 50 return nss_ZNEW(arena, PLHashEntry);
63 } 51 }
64 52
65 static void PR_CALLBACK 53 static void PR_CALLBACK
66 nss_arena_hash_free_entry 54 nss_arena_hash_free_entry(void *pool, PLHashEntry *he, PRUintn flag)
67 (
68 void *pool,
69 PLHashEntry *he,
70 PRUintn flag
71 )
72 { 55 {
73 if( HT_FREE_ENTRY == flag ) { 56 if (HT_FREE_ENTRY == flag) {
74 (void)nss_ZFreeIf(he); 57 (void)nss_ZFreeIf(he);
75 } 58 }
76 } 59 }
77 60
78 NSS_IMPLEMENT_DATA PLHashAllocOps 61 NSS_IMPLEMENT_DATA PLHashAllocOps nssArenaHashAllocOps = {
79 nssArenaHashAllocOps = { 62 nss_arena_hash_alloc_table, nss_arena_hash_free_table,
80 nss_arena_hash_alloc_table, 63 nss_arena_hash_alloc_entry, nss_arena_hash_free_entry
81 nss_arena_hash_free_table,
82 nss_arena_hash_alloc_entry,
83 nss_arena_hash_free_entry
84 }; 64 };
OLDNEW
« no previous file with comments | « nss/lib/base/hash.c ('k') | nss/lib/base/item.c » ('j') | nss/lib/util/secoid.c » ('J')

Powered by Google App Engine
This is Rietveld 408576698