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

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

Issue 2078763002: Delete bundled copy of NSS and replace with README. (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/nss@master
Patch Set: Delete bundled copy of NSS and replace with README. Created 4 years, 6 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
« no previous file with comments | « nss/lib/base/hash.c ('k') | 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 /*
6 * hashops.c
7 *
8 * This file includes a set of PLHashAllocOps that use NSSArenas.
9 */
10
11 #ifndef BASE_H
12 #include "base.h"
13 #endif /* BASE_H */
14
15 static void *PR_CALLBACK
16 nss_arena_hash_alloc_table(void *pool, PRSize size)
17 {
18 NSSArena *arena = (NSSArena *)NULL;
19
20 #ifdef NSSDEBUG
21 if ((void *)NULL != arena) {
22 if (PR_SUCCESS != nssArena_verifyPointer(arena)) {
23 return (void *)NULL;
24 }
25 }
26 #endif /* NSSDEBUG */
27
28 return nss_ZAlloc(arena, size);
29 }
30
31 static void PR_CALLBACK
32 nss_arena_hash_free_table(void *pool, void *item)
33 {
34 (void)nss_ZFreeIf(item);
35 }
36
37 static PLHashEntry *PR_CALLBACK
38 nss_arena_hash_alloc_entry(void *pool, const void *key)
39 {
40 NSSArena *arena = NULL;
41
42 #ifdef NSSDEBUG
43 if ((void *)NULL != arena) {
44 if (PR_SUCCESS != nssArena_verifyPointer(arena)) {
45 return (void *)NULL;
46 }
47 }
48 #endif /* NSSDEBUG */
49
50 return nss_ZNEW(arena, PLHashEntry);
51 }
52
53 static void PR_CALLBACK
54 nss_arena_hash_free_entry(void *pool, PLHashEntry *he, PRUintn flag)
55 {
56 if (HT_FREE_ENTRY == flag) {
57 (void)nss_ZFreeIf(he);
58 }
59 }
60
61 NSS_IMPLEMENT_DATA PLHashAllocOps nssArenaHashAllocOps = {
62 nss_arena_hash_alloc_table, nss_arena_hash_free_table,
63 nss_arena_hash_alloc_entry, nss_arena_hash_free_entry
64 };
OLDNEW
« no previous file with comments | « nss/lib/base/hash.c ('k') | nss/lib/base/item.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698