blob: 53d6eb28095bba9e7dd1380eb91d817765ce6738 [file] [log] [blame]
Kostya Serebryany1e172b42011-11-30 01:07:02 +00001//===-- asan_internal.h -----------------------------------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file is a part of AddressSanitizer, an address sanity checker.
11//
12// ASan-private header which defines various general utilities.
13//===----------------------------------------------------------------------===//
14#ifndef ASAN_INTERNAL_H
15#define ASAN_INTERNAL_H
16
Kostya Serebryany3f4c3872012-05-31 14:35:53 +000017#include "sanitizer_common/sanitizer_defs.h"
Kostya Serebryany16e00752012-05-31 13:42:53 +000018#include "sanitizer_common/sanitizer_libc.h"
Kostya Serebryanyb3cedf92012-05-29 12:18:18 +000019
Alexander Potapenko6f045292012-01-27 15:15:04 +000020#if !defined(__linux__) && !defined(__APPLE__) && !defined(_WIN32)
Kostya Serebryanyd6567c52011-12-01 21:40:52 +000021# error "This operating system is not supported by AddressSanitizer"
22#endif
23
Kostya Serebryany85822082012-01-30 20:55:02 +000024#if defined(_WIN32)
Timur Iskhodzhanov8c505ef2012-05-21 14:25:36 +000025# if defined(__clang__)
26typedef int intptr_t;
Kostya Serebryany3f4c3872012-05-31 14:35:53 +000027typedef unsigned int uptr;
Timur Iskhodzhanov8c505ef2012-05-21 14:25:36 +000028# endif
29
Alexander Potapenko6f045292012-01-27 15:15:04 +000030// There's no <stdint.h> in Visual Studio 9, so we have to define [u]int*_t.
31typedef unsigned __int8 uint8_t;
32typedef unsigned __int16 uint16_t;
33typedef unsigned __int32 uint32_t;
34typedef unsigned __int64 uint64_t;
35typedef __int8 int8_t;
36typedef __int16 int16_t;
37typedef __int32 int32_t;
38typedef __int64 int64_t;
Timur Iskhodzhanov600972e2012-02-24 15:28:43 +000039typedef unsigned long DWORD; // NOLINT
Alexey Samsonovadf2b032012-02-03 08:37:19 +000040
Alexander Potapenko71d3b392012-02-08 14:14:18 +000041extern "C" void* _ReturnAddress(void);
42# pragma intrinsic(_ReturnAddress)
43
Alexey Samsonovadf2b032012-02-03 08:37:19 +000044# define ALIAS(x) // TODO(timurrrr): do we need this on Windows?
45# define ALIGNED(x) __declspec(align(x))
46# define NOINLINE __declspec(noinline)
Timur Iskhodzhanov23bd2bb2012-03-13 16:12:03 +000047# define NORETURN __declspec(noreturn)
Alexey Samsonovadf2b032012-02-03 08:37:19 +000048
49# define ASAN_INTERFACE_ATTRIBUTE // TODO(timurrrr): do we need this on Win?
50#else // defined(_WIN32)
Kostya Serebryany85822082012-01-30 20:55:02 +000051# include <stdint.h> // for __WORDSIZE
Alexey Samsonovadf2b032012-02-03 08:37:19 +000052
53# define ALIAS(x) __attribute__((alias(x)))
54# define ALIGNED(x) __attribute__((aligned(x)))
55# define NOINLINE __attribute__((noinline))
Alexey Samsonov95d6b332012-03-20 10:14:55 +000056# define NORETURN __attribute__((noreturn))
Alexey Samsonovadf2b032012-02-03 08:37:19 +000057
58# define ASAN_INTERFACE_ATTRIBUTE __attribute__((visibility("default")))
59#endif // defined(_WIN32)
Kostya Serebryany1e172b42011-11-30 01:07:02 +000060
Daniel Dunbar46166332011-12-02 01:32:27 +000061// If __WORDSIZE was undefined by the platform, define it in terms of the
Kostya Serebryany669f5432012-01-31 18:13:50 +000062// compiler built-ins __LP64__ and _WIN64.
Daniel Dunbar46166332011-12-02 01:32:27 +000063#ifndef __WORDSIZE
Kostya Serebryany669f5432012-01-31 18:13:50 +000064#if __LP64__ || defined(_WIN64)
Daniel Dunbar46166332011-12-02 01:32:27 +000065#define __WORDSIZE 64
66#else
67#define __WORDSIZE 32
68#endif
69#endif
70
Alexey Samsonove4092f62012-02-22 12:54:04 +000071// Limits for integral types. We have to redefine it in case we don't
72// have stdint.h (like in Visual Studio 9).
73#if __WORDSIZE == 64
74# define __INT64_C(c) c ## L
75# define __UINT64_C(c) c ## UL
76#else
77# define __INT64_C(c) c ## LL
78# define __UINT64_C(c) c ## ULL
79#endif // __WORDSIZE == 64
Alexey Samsonovbfc694d2012-02-22 16:12:46 +000080#undef INT32_MIN
81#define INT32_MIN (-2147483647-1)
82#undef INT32_MAX
83#define INT32_MAX (2147483647)
84#undef UINT32_MAX
85#define UINT32_MAX (4294967295U)
86#undef INT64_MIN
87#define INT64_MIN (-__INT64_C(9223372036854775807)-1)
88#undef INT64_MAX
89#define INT64_MAX (__INT64_C(9223372036854775807))
90#undef UINT64_MAX
91#define UINT64_MAX (__UINT64_C(18446744073709551615))
Alexey Samsonove4092f62012-02-22 12:54:04 +000092
Alexey Samsonovb823e3c2012-02-22 14:07:06 +000093#define ASAN_DEFAULT_FAILURE_EXITCODE 1
94
Timur Iskhodzhanov3e81fe42012-02-09 17:20:14 +000095#if defined(__linux__)
96# define ASAN_LINUX 1
97#else
98# define ASAN_LINUX 0
99#endif
100
101#if defined(__APPLE__)
102# define ASAN_MAC 1
103#else
104# define ASAN_MAC 0
105#endif
106
107#if defined(_WIN32)
108# define ASAN_WINDOWS 1
109#else
110# define ASAN_WINDOWS 0
111#endif
112
Alexey Samsonov34a32022012-03-26 09:07:29 +0000113#define ASAN_POSIX (ASAN_LINUX || ASAN_MAC)
114
Alexander Potapenkoc8365232012-01-27 10:52:37 +0000115#if !defined(__has_feature)
116#define __has_feature(x) 0
117#endif
118
Kostya Serebryany850a49e2012-04-06 20:36:18 +0000119#if __has_feature(address_sanitizer)
Kostya Serebryany1e172b42011-11-30 01:07:02 +0000120# error "The AddressSanitizer run-time should not be"
121 " instrumented by AddressSanitizer"
122#endif
123
Kostya Serebryanyc6f22232011-12-08 18:30:42 +0000124// Build-time configuration options.
125
Kostya Serebryanyc6f22232011-12-08 18:30:42 +0000126// If set, asan will install its own SEGV signal handler.
127#ifndef ASAN_NEEDS_SEGV
128# define ASAN_NEEDS_SEGV 1
129#endif
130
131// If set, asan will intercept C++ exception api call(s).
132#ifndef ASAN_HAS_EXCEPTIONS
133# define ASAN_HAS_EXCEPTIONS 1
134#endif
135
136// If set, asan uses the values of SHADOW_SCALE and SHADOW_OFFSET
137// provided by the instrumented objects. Otherwise constants are used.
138#ifndef ASAN_FLEXIBLE_MAPPING_AND_OFFSET
139# define ASAN_FLEXIBLE_MAPPING_AND_OFFSET 0
140#endif
141
Evgeniy Stepanov8ae44ac2012-02-27 13:07:29 +0000142// If set, values like allocator chunk size, as well as defaults for some flags
143// will be changed towards less memory overhead.
144#ifndef ASAN_LOW_MEMORY
145# define ASAN_LOW_MEMORY 0
146#endif
147
Kostya Serebryany1e172b42011-11-30 01:07:02 +0000148// All internal functions in asan reside inside the __asan namespace
149// to avoid namespace collisions with the user programs.
150// Seperate namespace also makes it simpler to distinguish the asan run-time
151// functions from the instrumented user code in a profile.
152namespace __asan {
153
154class AsanThread;
155struct AsanStackTrace;
156
Kostya Serebryany218a9b72011-11-30 18:50:23 +0000157// asan_rtl.cc
Timur Iskhodzhanov23bd2bb2012-03-13 16:12:03 +0000158void NORETURN CheckFailed(const char *cond, const char *file, int line);
Timur Iskhodzhanovb55c88d2012-03-13 16:29:25 +0000159void NORETURN ShowStatsAndAbort();
Kostya Serebryany1e172b42011-11-30 01:07:02 +0000160
Kostya Serebryany218a9b72011-11-30 18:50:23 +0000161// asan_globals.cc
Kostya Serebryany3f4c3872012-05-31 14:35:53 +0000162bool DescribeAddrIfGlobal(uptr addr);
Kostya Serebryany1e172b42011-11-30 01:07:02 +0000163
Alexey Samsonov4d5f98d2012-04-06 08:21:08 +0000164void ReplaceOperatorsNewAndDelete();
Kostya Serebryany218a9b72011-11-30 18:50:23 +0000165// asan_malloc_linux.cc / asan_malloc_mac.cc
Kostya Serebryany1e172b42011-11-30 01:07:02 +0000166void ReplaceSystemMalloc();
167
Kostya Serebryany3f4c3872012-05-31 14:35:53 +0000168void OutOfMemoryMessageAndDie(const char *mem_type, uptr size);
Kostya Serebryanyde496f42011-12-28 22:58:01 +0000169
Alexander Potapenkof73a6a32012-02-13 17:09:40 +0000170// asan_linux.cc / asan_mac.cc / asan_win.cc
Kostya Serebryany1e172b42011-11-30 01:07:02 +0000171void *AsanDoesNotSupportStaticLinkage();
Alexander Potapenkof73a6a32012-02-13 17:09:40 +0000172bool AsanShadowRangeIsAvailable();
Kostya Serebryanyde496f42011-12-28 22:58:01 +0000173int AsanOpenReadonly(const char* filename);
Alexander Potapenko1e316d72012-01-13 12:59:48 +0000174const char *AsanGetEnv(const char *name);
Alexander Potapenko99d17eb2012-02-22 09:11:55 +0000175void AsanDumpProcessMap();
Kostya Serebryanyde496f42011-12-28 22:58:01 +0000176
Kostya Serebryany3f4c3872012-05-31 14:35:53 +0000177void *AsanMmapFixedNoReserve(uptr fixed_addr, uptr size);
178void *AsanMmapFixedReserve(uptr fixed_addr, uptr size);
179void *AsanMprotect(uptr fixed_addr, uptr size);
180void *AsanMmapSomewhereOrDie(uptr size, const char *where);
181void AsanUnmapOrDie(void *ptr, uptr size);
Kostya Serebryanyde496f42011-12-28 22:58:01 +0000182
Kostya Serebryanyef14ff62012-01-06 02:12:25 +0000183void AsanDisableCoreDumper();
Kostya Serebryany3f4c3872012-05-31 14:35:53 +0000184void GetPcSpBp(void *context, uptr *pc, uptr *sp, uptr *bp);
Kostya Serebryanyef14ff62012-01-06 02:12:25 +0000185
Kostya Serebryany3f4c3872012-05-31 14:35:53 +0000186uptr AsanRead(int fd, void *buf, uptr count);
187uptr AsanWrite(int fd, const void *buf, uptr count);
Kostya Serebryanyde496f42011-12-28 22:58:01 +0000188int AsanClose(int fd);
Kostya Serebryany1e172b42011-11-30 01:07:02 +0000189
Kostya Serebryany4803ab92012-01-09 18:53:15 +0000190bool AsanInterceptsSignal(int signum);
Alexander Potapenkof03d8af2012-04-05 10:54:52 +0000191void SetAlternateSignalStack();
192void UnsetAlternateSignalStack();
Kostya Serebryanya7e760a2012-01-09 19:18:27 +0000193void InstallSignalHandlers();
Kostya Serebryany0ecf5eb2012-01-09 23:11:26 +0000194int GetPid();
Kostya Serebryany3f4c3872012-05-31 14:35:53 +0000195uptr GetThreadSelf();
Kostya Serebryanydde7c332012-01-11 02:39:16 +0000196int AtomicInc(int *a);
Kostya Serebryanyf1e82b82012-04-05 15:55:09 +0000197uint16_t AtomicExchange(uint16_t *a, uint16_t new_val);
Kostya Serebryanycc4e6862012-01-11 02:21:06 +0000198
199// Wrapper for TLS/TSD.
Kostya Serebryanyf58f9982012-02-07 00:27:15 +0000200void AsanTSDInit(void (*destructor)(void *tsd));
Kostya Serebryanycc4e6862012-01-11 02:21:06 +0000201void *AsanTSDGet();
202void AsanTSDSet(void *tsd);
Kostya Serebryany4803ab92012-01-09 18:53:15 +0000203
Kostya Serebryanydf499b42012-01-05 00:44:33 +0000204// Opens the file 'file_name" and reads up to 'max_len' bytes.
205// The resulting buffer is mmaped and stored in '*buff'.
206// The size of the mmaped region is stored in '*buff_size',
Kostya Serebryany0ecf5eb2012-01-09 23:11:26 +0000207// Returns the number of read bytes or 0 if file can not be opened.
Kostya Serebryany3f4c3872012-05-31 14:35:53 +0000208uptr ReadFileToBuffer(const char *file_name, char **buff,
209 uptr *buff_size, uptr max_len);
Kostya Serebryanydf499b42012-01-05 00:44:33 +0000210
Kostya Serebryany218a9b72011-11-30 18:50:23 +0000211// asan_printf.cc
Kostya Serebryany1e172b42011-11-30 01:07:02 +0000212void RawWrite(const char *buffer);
Kostya Serebryany3f4c3872012-05-31 14:35:53 +0000213int SNPrintf(char *buffer, uptr length, const char *format, ...);
Kostya Serebryany1e172b42011-11-30 01:07:02 +0000214void Printf(const char *format, ...);
Kostya Serebryanydf499b42012-01-05 00:44:33 +0000215int SScanf(const char *str, const char *format, ...);
Kostya Serebryany1e172b42011-11-30 01:07:02 +0000216void Report(const char *format, ...);
217
Kostya Serebryany2d8b3bd2011-12-02 18:42:04 +0000218// Don't use std::min and std::max, to minimize dependency on libstdc++.
219template<class T> T Min(T a, T b) { return a < b ? a : b; }
220template<class T> T Max(T a, T b) { return a > b ? a : b; }
221
Kostya Serebryany3f4c3872012-05-31 14:35:53 +0000222void SortArray(uptr *array, uptr size);
Kostya Serebryany25c71782012-03-10 01:30:01 +0000223
Kostya Serebryany218a9b72011-11-30 18:50:23 +0000224// asan_poisoning.cc
225// Poisons the shadow memory for "size" bytes starting from "addr".
Kostya Serebryany3f4c3872012-05-31 14:35:53 +0000226void PoisonShadow(uptr addr, uptr size, uint8_t value);
Kostya Serebryany218a9b72011-11-30 18:50:23 +0000227// Poisons the shadow memory for "redzone_size" bytes starting from
228// "addr + size".
Kostya Serebryany3f4c3872012-05-31 14:35:53 +0000229void PoisonShadowPartialRightRedzone(uptr addr,
230 uptr size,
231 uptr redzone_size,
Kostya Serebryany218a9b72011-11-30 18:50:23 +0000232 uint8_t value);
233
Alexey Samsonov38dd4ed2012-03-20 10:54:40 +0000234// Platfrom-specific options.
235#ifdef __APPLE__
236bool PlatformHasDifferentMemcpyAndMemmove();
237# define PLATFORM_HAS_DIFFERENT_MEMCPY_AND_MEMMOVE \
238 (PlatformHasDifferentMemcpyAndMemmove())
239#else
240# define PLATFORM_HAS_DIFFERENT_MEMCPY_AND_MEMMOVE true
241#endif // __APPLE__
242
Kostya Serebryany3f4c3872012-05-31 14:35:53 +0000243extern uptr FLAG_quarantine_size;
Alexander Potapenko62f10e72012-05-28 16:21:19 +0000244extern int64_t FLAG_demangle;
245extern bool FLAG_symbolize;
246extern int64_t FLAG_v;
Kostya Serebryany3f4c3872012-05-31 14:35:53 +0000247extern uptr FLAG_redzone;
Alexander Potapenko62f10e72012-05-28 16:21:19 +0000248extern int64_t FLAG_debug;
249extern bool FLAG_poison_shadow;
250extern int64_t FLAG_report_globals;
Kostya Serebryany3f4c3872012-05-31 14:35:53 +0000251extern uptr FLAG_malloc_context_size;
Alexander Potapenko62f10e72012-05-28 16:21:19 +0000252extern bool FLAG_replace_str;
253extern bool FLAG_replace_intrin;
254extern bool FLAG_replace_cfallocator;
255extern bool FLAG_fast_unwind;
256extern bool FLAG_use_fake_stack;
Kostya Serebryany3f4c3872012-05-31 14:35:53 +0000257extern uptr FLAG_max_malloc_fill_size;
Alexander Potapenko62f10e72012-05-28 16:21:19 +0000258extern int64_t FLAG_exitcode;
259extern bool FLAG_allow_user_poisoning;
260extern int64_t FLAG_sleep_before_dying;
261extern bool FLAG_handle_segv;
262extern bool FLAG_use_sigaltstack;
263extern bool FLAG_check_malloc_usable_size;
Kostya Serebryany1e172b42011-11-30 01:07:02 +0000264
265extern int asan_inited;
266// Used to avoid infinite recursion in __asan_init().
267extern bool asan_init_is_running;
268
269enum LinkerInitialized { LINKER_INITIALIZED = 0 };
270
Timur Iskhodzhanovb55c88d2012-03-13 16:29:25 +0000271void NORETURN AsanDie();
Kostya Serebryanye1fe0fd2012-02-13 21:24:29 +0000272void SleepForSeconds(int seconds);
Timur Iskhodzhanovb55c88d2012-03-13 16:29:25 +0000273void NORETURN Exit(int exitcode);
Kostya Serebryanyf8e6fee2012-04-06 01:27:11 +0000274void NORETURN Abort();
Alexey Samsonovb823e3c2012-02-22 14:07:06 +0000275int Atexit(void (*function)(void));
Kostya Serebryany1e172b42011-11-30 01:07:02 +0000276
277#define CHECK(cond) do { if (!(cond)) { \
278 CheckFailed(#cond, __FILE__, __LINE__); \
279}}while(0)
280
281#define RAW_CHECK_MSG(expr, msg) do { \
282 if (!(expr)) { \
283 RawWrite(msg); \
Kostya Serebryany0ecf5eb2012-01-09 23:11:26 +0000284 AsanDie(); \
Kostya Serebryany1e172b42011-11-30 01:07:02 +0000285 } \
286} while (0)
287
288#define RAW_CHECK(expr) RAW_CHECK_MSG(expr, #expr)
289
290#define UNIMPLEMENTED() CHECK("unimplemented" && 0)
291
292#define ASAN_ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0]))
293
Kostya Serebryany3f4c3872012-05-31 14:35:53 +0000294const uptr kWordSize = __WORDSIZE / 8;
295const uptr kWordSizeInBits = 8 * kWordSize;
296const uptr kPageSizeBits = 12;
297const uptr kPageSize = 1UL << kPageSizeBits;
Kostya Serebryany1e172b42011-11-30 01:07:02 +0000298
Timur Iskhodzhanov8c505ef2012-05-21 14:25:36 +0000299#if !defined(_WIN32) || defined(__clang__)
Kostya Serebryany3f4c3872012-05-31 14:35:53 +0000300# define GET_CALLER_PC() (uptr)__builtin_return_address(0)
301# define GET_CURRENT_FRAME() (uptr)__builtin_frame_address(0)
Alexander Potapenko6f045292012-01-27 15:15:04 +0000302#else
Kostya Serebryany3f4c3872012-05-31 14:35:53 +0000303# define GET_CALLER_PC() (uptr)_ReturnAddress()
Kostya Serebryany1c83ae32012-02-07 18:23:54 +0000304// CaptureStackBackTrace doesn't need to know BP on Windows.
305// FIXME: This macro is still used when printing error reports though it's not
306// clear if the BP value is needed in the ASan reports on Windows.
Kostya Serebryany3f4c3872012-05-31 14:35:53 +0000307# define GET_CURRENT_FRAME() (uptr)0xDEADBEEF
Timur Iskhodzhanov8c505ef2012-05-21 14:25:36 +0000308#endif
309
310#ifndef _WIN32
Kostya Serebryany3f4c3872012-05-31 14:35:53 +0000311const uptr kMmapGranularity = kPageSize;
Timur Iskhodzhanov8c505ef2012-05-21 14:25:36 +0000312# define THREAD_CALLING_CONV
313typedef void* thread_return_t;
314#else
Kostya Serebryany3f4c3872012-05-31 14:35:53 +0000315const uptr kMmapGranularity = 1UL << 16;
Timur Iskhodzhanov600972e2012-02-24 15:28:43 +0000316# define THREAD_CALLING_CONV __stdcall
317typedef DWORD thread_return_t;
Timur Iskhodzhanov3e81fe42012-02-09 17:20:14 +0000318
319# ifndef ASAN_USE_EXTERNAL_SYMBOLIZER
Timur Iskhodzhanov8c505ef2012-05-21 14:25:36 +0000320# define ASAN_USE_EXTERNAL_SYMBOLIZER __asan_WinSymbolize
321bool __asan_WinSymbolize(const void *addr, char *out_buffer, int buffer_size);
Timur Iskhodzhanov3e81fe42012-02-09 17:20:14 +0000322# endif
Alexander Potapenko6f045292012-01-27 15:15:04 +0000323#endif
Kostya Serebryany1e172b42011-11-30 01:07:02 +0000324
Timur Iskhodzhanov600972e2012-02-24 15:28:43 +0000325typedef thread_return_t (THREAD_CALLING_CONV *thread_callback_t)(void* arg);
326
Kostya Serebryany1e172b42011-11-30 01:07:02 +0000327// These magic values are written to shadow for better error reporting.
328const int kAsanHeapLeftRedzoneMagic = 0xfa;
329const int kAsanHeapRightRedzoneMagic = 0xfb;
330const int kAsanHeapFreeMagic = 0xfd;
331const int kAsanStackLeftRedzoneMagic = 0xf1;
332const int kAsanStackMidRedzoneMagic = 0xf2;
333const int kAsanStackRightRedzoneMagic = 0xf3;
334const int kAsanStackPartialRedzoneMagic = 0xf4;
335const int kAsanStackAfterReturnMagic = 0xf5;
336const int kAsanUserPoisonedMemoryMagic = 0xf7;
337const int kAsanGlobalRedzoneMagic = 0xf9;
Kostya Serebryany6b30e2c2011-12-15 17:41:30 +0000338const int kAsanInternalHeapMagic = 0xfe;
Kostya Serebryany1e172b42011-11-30 01:07:02 +0000339
Kostya Serebryany3f4c3872012-05-31 14:35:53 +0000340static const uptr kCurrentStackFrameMagic = 0x41B58AB3;
341static const uptr kRetiredStackFrameMagic = 0x45E0360E;
Kostya Serebryany1e172b42011-11-30 01:07:02 +0000342
Kostya Serebryanyde496f42011-12-28 22:58:01 +0000343// --------------------------- Bit twiddling ------- {{{1
Kostya Serebryany3f4c3872012-05-31 14:35:53 +0000344inline bool IsPowerOfTwo(uptr x) {
Kostya Serebryanyde496f42011-12-28 22:58:01 +0000345 return (x & (x - 1)) == 0;
346}
347
Kostya Serebryany3f4c3872012-05-31 14:35:53 +0000348inline uptr RoundUpTo(uptr size, uptr boundary) {
Kostya Serebryanyde496f42011-12-28 22:58:01 +0000349 CHECK(IsPowerOfTwo(boundary));
350 return (size + boundary - 1) & ~(boundary - 1);
351}
352
Kostya Serebryanyb89567c2011-12-02 21:02:20 +0000353// -------------------------- LowLevelAllocator ----- {{{1
354// A simple low-level memory allocator for internal use.
355class LowLevelAllocator {
356 public:
357 explicit LowLevelAllocator(LinkerInitialized) {}
358 // 'size' must be a power of two.
359 // Requires an external lock.
Kostya Serebryany3f4c3872012-05-31 14:35:53 +0000360 void *Allocate(uptr size);
Kostya Serebryanyb89567c2011-12-02 21:02:20 +0000361 private:
362 char *allocated_end_;
363 char *allocated_current_;
364};
365
Kostya Serebryany1e172b42011-11-30 01:07:02 +0000366} // namespace __asan
367
368#endif // ASAN_INTERNAL_H