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

Unified Diff: courgette/memory_allocator.h

Issue 1543643002: Switch to standard integer types in courgette/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 5 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « courgette/label_manager_unittest.cc ('k') | courgette/memory_allocator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: courgette/memory_allocator.h
diff --git a/courgette/memory_allocator.h b/courgette/memory_allocator.h
index 59d3ec84ac7a22749a3ec2c08619192a6bbbb6eb..6541e9138f30772b5b7566f4a5ed607f1dfb9c09 100644
--- a/courgette/memory_allocator.h
+++ b/courgette/memory_allocator.h
@@ -5,9 +5,10 @@
#ifndef COURGETTE_MEMORY_ALLOCATOR_H_
#define COURGETTE_MEMORY_ALLOCATOR_H_
+#include <stddef.h>
+#include <stdint.h>
#include <stdlib.h>
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/files/file.h"
#include "base/files/file_path.h"
@@ -194,12 +195,12 @@ class MemoryAllocator {
}
void deallocate(pointer ptr, size_type size) {
- uint8* mem = reinterpret_cast<uint8*>(ptr);
+ uint8_t* mem = reinterpret_cast<uint8_t*>(ptr);
mem -= sizeof(T);
if (mem[0] == HEAP_ALLOCATION) {
free(mem);
} else {
- DCHECK_EQ(static_cast<uint8>(FILE_ALLOCATION), mem[0]);
+ DCHECK_EQ(static_cast<uint8_t>(FILE_ALLOCATION), mem[0]);
UncheckedDelete(TempMapping::GetMappingFromPtr(mem));
}
}
@@ -215,20 +216,20 @@ class MemoryAllocator {
return NULL;
size_type bytes = count * sizeof(T);
- uint8* mem = NULL;
+ uint8_t* mem = NULL;
// First see if we can do this allocation on the heap.
if (count < kMaxHeapAllocationSize &&
base::UncheckedMalloc(bytes, reinterpret_cast<void**>(&mem))) {
- mem[0] = static_cast<uint8>(HEAP_ALLOCATION);
+ mem[0] = static_cast<uint8_t>(HEAP_ALLOCATION);
} else {
// Back the allocation with a temp file if either the request exceeds the
// max heap allocation threshold or the heap allocation failed.
TempMapping* mapping = UncheckedNew<TempMapping>();
if (mapping) {
if (mapping->Initialize(bytes)) {
- mem = reinterpret_cast<uint8*>(mapping->memory());
- mem[0] = static_cast<uint8>(FILE_ALLOCATION);
+ mem = reinterpret_cast<uint8_t*>(mapping->memory());
+ mem[0] = static_cast<uint8_t>(FILE_ALLOCATION);
} else {
UncheckedDelete(mapping);
}
« no previous file with comments | « courgette/label_manager_unittest.cc ('k') | courgette/memory_allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698