diff options
author | dalecurtis@chromium.org <dalecurtis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-23 23:26:50 +0000 |
---|---|---|
committer | dalecurtis@chromium.org <dalecurtis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-23 23:26:50 +0000 |
commit | f8f5593b34f0cf7563186381124172a336eebf99 (patch) | |
tree | e74300a161f45a5712b74a18f9fd965c776b12b9 /crypto/openssl_util.cc | |
parent | 6075da4aecf7073f270cc0dd1306cc57b102671b (diff) | |
download | chromium_src-f8f5593b34f0cf7563186381124172a336eebf99.zip chromium_src-f8f5593b34f0cf7563186381124172a336eebf99.tar.gz chromium_src-f8f5593b34f0cf7563186381124172a336eebf99.tar.bz2 |
Upgrade AlignedMemory to support dynamic allocations.
Adds two new methods: AlignedAlloc and AlignedFree for creating and
destroying dynamic aligned allocations respectively. Also adds a
helper class, ScopedPtrAlignedFree, for use with scoped_ptr_malloc.
AlignedAlloc uses posix_memalign for OS X (now that we're targeting
10.6), Linux and _aligned_alloc() on Windows. Android and NaCl use
memalign() since they do not expose posix_memalign() and memalign()
is safe to use with free() on those platforms.
Also hacks around a bug in Visual C++ where __alignof will sometimes
return zero:
http://connect.microsoft.com/VisualStudio/feedback/details/682695/c-alignof-fails-to-properly-evalute-alignment-of-dependent-types
BUG=none
TEST=base_unittests + new test, trybots.
Review URL: https://chromiumcodereview.appspot.com/10796020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147988 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'crypto/openssl_util.cc')
0 files changed, 0 insertions, 0 deletions