OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. |
3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
5 */ | 5 */ |
6 | 6 |
7 /* | 7 /* |
8 * This provides a private allocator to be used only within the IRT. | 8 * This provides a private allocator to be used only within the IRT. |
9 * This is distinct from the user application's allocators. This | 9 * This is distinct from the user application's allocators. This |
10 * allocator cannot use sbrk (the NaCl sysbrk syscall), which is | 10 * allocator cannot use sbrk (the NaCl brk syscall), which is reserved |
11 * reserved for the user application. | 11 * for the user application. |
12 * | 12 * |
13 * NOTE: However, this allocator is exposed to PPAPI applications via the | 13 * NOTE: However, this allocator is exposed to PPAPI applications via the |
14 * PPB_Core MemAlloc and MemFree function pointers. That should go away. | 14 * PPB_Core MemAlloc and MemFree function pointers. That should go away. |
15 * See http://code.google.com/p/chromium/issues/detail?id=80610 | 15 * See http://code.google.com/p/chromium/issues/detail?id=80610 |
16 */ | 16 */ |
17 | 17 |
18 #include <errno.h> | 18 #include <errno.h> |
19 #include <pthread.h> | 19 #include <pthread.h> |
20 #include <unistd.h> | 20 #include <unistd.h> |
21 | 21 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 | 79 |
80 /* | 80 /* |
81 * This must never be called. It's here to catch any stray calls. | 81 * This must never be called. It's here to catch any stray calls. |
82 */ | 82 */ |
83 void *sbrk(intptr_t increment) { | 83 void *sbrk(intptr_t increment) { |
84 static const char msg[] = "BUG! IRT code called sbrk\n"; | 84 static const char msg[] = "BUG! IRT code called sbrk\n"; |
85 write(2, msg, sizeof(msg) - 1); | 85 write(2, msg, sizeof(msg) - 1); |
86 _exit(-1); | 86 _exit(-1); |
87 return NULL; | 87 return NULL; |
88 } | 88 } |
OLD | NEW |