Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Langley <agl@chromium.org>2015-02-06 22:52:16 +0300
committerAdam Langley <agl@chromium.org>2015-02-10 04:35:31 +0300
commit29b186736c1e95e2005b13674a6930b282b55e21 (patch)
tree02ddb5e6055c305410dcea5f9730e7e294d18702 /crypto/buf
parent65226257c1c49eac4a739b9d57409b52dfbb5d45 (diff)
Precompute sorted array for error strings.
Previously, error strings were kept in arrays for each subdirectory and err.c would iterate over them all and insert them at init time to a hash table. This means that, even if you have a shared library and lots of processes using that, each process has ~30KB of private memory from building that hash table. This this change, all the error strings are built into a sorted list and are thus static data. This means that processes can share the error information and it actually saves binary space because of all the pointer overhead in the old scheme. Also it saves the time taken building the hash table at startup. This removes support for externally-supplied error string data. Change-Id: Ifca04f335c673a048e1a3e76ff2b69c7264635be
Diffstat (limited to 'crypto/buf')
-rw-r--r--crypto/buf/CMakeLists.txt1
-rw-r--r--crypto/buf/buf_error.c25
2 files changed, 0 insertions, 26 deletions
diff --git a/crypto/buf/CMakeLists.txt b/crypto/buf/CMakeLists.txt
index dabf8d12..19edf7d5 100644
--- a/crypto/buf/CMakeLists.txt
+++ b/crypto/buf/CMakeLists.txt
@@ -6,5 +6,4 @@ add_library(
OBJECT
buf.c
- buf_error.c
)
diff --git a/crypto/buf/buf_error.c b/crypto/buf/buf_error.c
deleted file mode 100644
index fac60111..00000000
--- a/crypto/buf/buf_error.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Copyright (c) 2014, Google Inc.
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
- * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
-
-#include <openssl/err.h>
-
-#include <openssl/buf.h>
-
-const ERR_STRING_DATA BUF_error_string_data[] = {
- {ERR_PACK(ERR_LIB_BUF, BUF_F_BUF_MEM_new, 0), "BUF_MEM_new"},
- {ERR_PACK(ERR_LIB_BUF, BUF_F_BUF_memdup, 0), "BUF_memdup"},
- {ERR_PACK(ERR_LIB_BUF, BUF_F_BUF_strndup, 0), "BUF_strndup"},
- {ERR_PACK(ERR_LIB_BUF, BUF_F_buf_mem_grow, 0), "buf_mem_grow"},
- {0, NULL},
-};