diff options
author | David 'Digit' Turner <digit@android.com> | 2011-06-14 21:58:55 +0200 |
---|---|---|
committer | David 'Digit' Turner <digit@android.com> | 2011-06-14 21:58:55 +0200 |
commit | 7c72513bfa2a10f48e3205e7d8bf66f6ee1a7082 (patch) | |
tree | cb3a3a0498560224a923bbf912b90062cc3bdd09 /libstdc++ | |
parent | b127b1f208e67d74a7ee94ad2bd0ffb2fed3af6b (diff) | |
download | bionic-7c72513bfa2a10f48e3205e7d8bf66f6ee1a7082.zip bionic-7c72513bfa2a10f48e3205e7d8bf66f6ee1a7082.tar.gz bionic-7c72513bfa2a10f48e3205e7d8bf66f6ee1a7082.tar.bz2 |
libstdc++: make operator new call abort on failure.
This change ensures that operator new will call abort() in case
of memory allocation failure. Note that due to our usage of memory
overcommit, this can only happen under very rare circumstances
(i.e. trying to allocate memory larger than the larger free range
of virtual address space, or when memory is corrutped in various
ways).
Change-Id: I128b8bf626216e899c22a00f24492cd148a1fc94
Diffstat (limited to 'libstdc++')
-rw-r--r-- | libstdc++/src/new.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libstdc++/src/new.cpp b/libstdc++/src/new.cpp index a9c92d4..ddd3dba 100644 --- a/libstdc++/src/new.cpp +++ b/libstdc++/src/new.cpp @@ -7,7 +7,7 @@ void* operator new(std::size_t size) { void* p = malloc(size); if (p == NULL) { - // abort(); + abort(); } return p; } @@ -16,7 +16,7 @@ void* operator new[](std::size_t size) { void* p = malloc(size); if (p == NULL) { - // abort(); + abort(); } return p; } |