svn commit: r1931369 - subversion/trunk/subversion/tests/libsvn_subr

[email protected]
Newsgroups gmane.comp.version-control.subversion.svn
Message-ID <176857861986.2787152.5767610317354035996@svn02-us-east.apache.org>
Author: brane
Date: Fri Jan 16 15:50:19 2026
New Revision: 1931369

Log:
Don't allocate four times more space than needed. Duh.

* subversion/tests/libsvn_subr/adler32-test.c
  (make_random_data): We just worked out how many 32-bit random
   integers we'll generate, so maybe allocate space for only so many?

Modified:
   subversion/trunk/subversion/tests/libsvn_subr/adler32-test.c

Modified: subversion/trunk/subversion/tests/libsvn_subr/adler32-test.c
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/adler32-test.c	Fri Jan 16 15:16:21 2026	(r1931368)
+++ subversion/trunk/subversion/tests/libsvn_subr/adler32-test.c	Fri Jan 16 15:50:19 2026	(r1931369)
@@ -40,7 +40,7 @@ static const char *make_random_data(apr_
 {
   const apr_off_t count = (len /  sizeof(apr_uint32_t)
                            + (len %  sizeof(apr_uint32_t) ? 1 : 0));
-  apr_uint32_t *data = apr_palloc(pool, len * sizeof(*data));
+  apr_uint32_t *data = apr_palloc(pool, count * sizeof(*data));
   apr_uint32_t seed = *initial_seed = (apr_uint32_t)apr_time_now();
   apr_off_t i;
 
@@ -115,7 +115,6 @@ do_random_test(apr_uint32_t *seed,
                const apr_size_t array_size,
                apr_pool_t *pool)
 {
-
   const char *data = make_random_data(seed, lengths[array_size - 1], pool);
   int i;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.