Skip to content

Commit

Permalink
Precompute sorted array for error strings.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Adam Langley committed Feb 10, 2015
1 parent 6522625 commit 29b1867
Show file tree
Hide file tree
Showing 76 changed files with 3,592 additions and 2,358 deletions.
1 change: 0 additions & 1 deletion crypto/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ add_library(
crypto

crypto.c
crypto_error.c
mem.c
thread.c
ex_data.c
Expand Down
1 change: 0 additions & 1 deletion crypto/asn1/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ add_library(
a_type.c
a_utctm.c
a_utf8.c
asn1_error.c
asn1_lib.c
asn1_par.c
asn_pack.c
Expand Down
203 changes: 0 additions & 203 deletions crypto/asn1/asn1_error.c

This file was deleted.

1 change: 0 additions & 1 deletion crypto/bio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ add_library(
OBJECT

bio.c
bio_error.c
bio_mem.c
buffer.c
connect.c
Expand Down
59 changes: 0 additions & 59 deletions crypto/bio/bio_error.c

This file was deleted.

1 change: 0 additions & 1 deletion crypto/bn/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ add_library(

OBJECT

bn_error.c
add.c
bn.c
cmp.c
Expand Down
Loading

0 comments on commit 29b1867

Please sign in to comment.