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

Side by Side Diff: third_party/brotli/dec/safe_malloc.h

Issue 1433383003: Remove //third_party/brotli and //third_party/ots. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 1 month 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 | « third_party/brotli/dec/prefix.h ('k') | third_party/brotli/dec/safe_malloc.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 /* Copyright 2013 Google Inc. All Rights Reserved.
2
3 Licensed under the Apache License, Version 2.0 (the "License");
4 you may not use this file except in compliance with the License.
5 You may obtain a copy of the License at
6
7 http://www.apache.org/licenses/LICENSE-2.0
8
9 Unless required by applicable law or agreed to in writing, software
10 distributed under the License is distributed on an "AS IS" BASIS,
11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 See the License for the specific language governing permissions and
13 limitations under the License.
14
15 Size-checked memory allocation.
16 */
17
18 #ifndef BROTLI_DEC_SAFE_MALLOC_H_
19 #define BROTLI_DEC_SAFE_MALLOC_H_
20
21 #include <assert.h>
22
23 #include "./types.h"
24
25 #if defined(__cplusplus) || defined(c_plusplus)
26 extern "C" {
27 #endif
28
29 /* This is the maximum memory amount that we will ever try to allocate. */
30 #define BROTLI_MAX_ALLOCABLE_MEMORY (1 << 30)
31
32 /* size-checking safe malloc/calloc: verify that the requested size is not too
33 large, or return NULL. You don't need to call these for constructs like
34 malloc(sizeof(foo)), but only if there's font-dependent size involved
35 somewhere (like: malloc(decoded_size * sizeof(*something))). That's why this
36 safe malloc() borrows the signature from calloc(), pointing at the dangerous
37 underlying multiply involved.
38 */
39 void* BrotliSafeMalloc(uint64_t nmemb, size_t size);
40
41 #if defined(__cplusplus) || defined(c_plusplus)
42 } /* extern "C" */
43 #endif
44
45 #endif /* BROTLI_DEC_SAFE_MALLOC_H_ */
OLDNEW
« no previous file with comments | « third_party/brotli/dec/prefix.h ('k') | third_party/brotli/dec/safe_malloc.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698