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

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

Issue 14249009: Change the NSS and NSPR source tree to the new directory structure to be (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/nss/
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « mozilla/security/nss/lib/base/hash.c ('k') | mozilla/security/nss/lib/base/item.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5 #ifdef DEBUG
6 static const char CVS_ID[] = "@(#) $RCSfile: hashops.c,v $ $Revision: 1.7 $ $Dat e: 2012/04/25 14:49:26 $";
7 #endif /* DEBUG */
8
9 /*
10 * hashops.c
11 *
12 * This file includes a set of PLHashAllocOps that use NSSArenas.
13 */
14
15 #ifndef BASE_H
16 #include "base.h"
17 #endif /* BASE_H */
18
19 static void * PR_CALLBACK
20 nss_arena_hash_alloc_table
21 (
22 void *pool,
23 PRSize size
24 )
25 {
26 NSSArena *arena = (NSSArena *)NULL;
27
28 #ifdef NSSDEBUG
29 if( (void *)NULL != arena ) {
30 if( PR_SUCCESS != nssArena_verifyPointer(arena) ) {
31 return (void *)NULL;
32 }
33 }
34 #endif /* NSSDEBUG */
35
36 return nss_ZAlloc(arena, size);
37 }
38
39 static void PR_CALLBACK
40 nss_arena_hash_free_table
41 (
42 void *pool,
43 void *item
44 )
45 {
46 (void)nss_ZFreeIf(item);
47 }
48
49 static PLHashEntry * PR_CALLBACK
50 nss_arena_hash_alloc_entry
51 (
52 void *pool,
53 const void *key
54 )
55 {
56 NSSArena *arena = NULL;
57
58 #ifdef NSSDEBUG
59 if( (void *)NULL != arena ) {
60 if( PR_SUCCESS != nssArena_verifyPointer(arena) ) {
61 return (void *)NULL;
62 }
63 }
64 #endif /* NSSDEBUG */
65
66 return nss_ZNEW(arena, PLHashEntry);
67 }
68
69 static void PR_CALLBACK
70 nss_arena_hash_free_entry
71 (
72 void *pool,
73 PLHashEntry *he,
74 PRUintn flag
75 )
76 {
77 if( HT_FREE_ENTRY == flag ) {
78 (void)nss_ZFreeIf(he);
79 }
80 }
81
82 NSS_IMPLEMENT_DATA PLHashAllocOps
83 nssArenaHashAllocOps = {
84 nss_arena_hash_alloc_table,
85 nss_arena_hash_free_table,
86 nss_arena_hash_alloc_entry,
87 nss_arena_hash_free_entry
88 };
OLDNEW
« no previous file with comments | « mozilla/security/nss/lib/base/hash.c ('k') | mozilla/security/nss/lib/base/item.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698