summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* The 'flags' field in apr_pollset_private_t looks unused.jailletc362023-02-191-1/+0
| | | | | | Remove it to save 8 bytes (on 64 bits arch) when such a struct is allocated. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1907751 13f79535-47bb-0310-9956-ffa450edef68
* Re-order the fields of 'struct apr_finfo_t' to avoid a hole and some padding.jailletc362023-02-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On x86_64, this shrinks the size of the struct from 120 to 112 bytes. Before the patch, pahole states that: struct apr_finfo_t { apr_pool_t * pool; /* 0 8 */ apr_int32_t valid; /* 8 4 */ apr_fileperms_t protection; /* 12 4 */ apr_filetype_e filetype; /* 16 4 */ apr_uid_t user; /* 20 4 */ apr_gid_t group; /* 24 4 */ /* XXX 4 bytes hole, try to pack */ apr_ino_t inode; /* 32 8 */ apr_dev_t device; /* 40 8 */ apr_int32_t nlink; /* 48 4 */ /* XXX 4 bytes hole, try to pack */ apr_off_t size; /* 56 8 */ /* --- cacheline 1 boundary (64 bytes) --- */ apr_off_t csize; /* 64 8 */ apr_time_t atime; /* 72 8 */ apr_time_t mtime; /* 80 8 */ apr_time_t ctime; /* 88 8 */ const char * fname; /* 96 8 */ const char * name; /* 104 8 */ struct apr_file_t * filehand; /* 112 8 */ /* size: 120, cachelines: 2, members: 17 */ /* sum members: 112, holes: 2, sum holes: 8 */ /* last cacheline: 56 bytes */ }; git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1907750 13f79535-47bb-0310-9956-ffa450edef68
* duplicate linecovener2023-02-171-1/+0
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1907718 13f79535-47bb-0310-9956-ffa450edef68
* atomic64: Generic apr_atomic_read64() to always use a lock.ylavic2023-02-151-12/+0
| | | | | | | | | | | | | | | | | Don't play games with sizeof(void*) to determine whether a raw load intruction is atomic or not. Systems that fall back to the generic implementation are not eligible for the compiler builtins or CPU native atomic intructions already, and we don't want to reimplement that here (e.g. alignment, ordering guarantees, ...). * atomic/unix/mutex64.c(apr_atomic_read64): No #ifdefery, always take the lock. Follow up to r1907541. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1907678 13f79535-47bb-0310-9956-ffa450edef68
* testatomic: initialize in the test the globals used by it.ylavic2023-02-151-0/+3
| | | | | | | | | Just in case the test is later reordered (e.g. test_atomics_threaded64 and test_atomics_threaded_setread64 use the same atomic_ops64 variable). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1907677 13f79535-47bb-0310-9956-ffa450edef68
* configure: Test apr_uint64_t alignment for 64bit atomic builtins usability.ylavic2023-02-141-25/+43
| | | | | | | | | | | | | | | | | | | | | | | On some systems the __atomic builtins may be available only through libatomic or fall back to libatomic when the atomic operations are not issued on a suitably aligned address (64bit atomics on 8-byte aligned addresses only for instance). Modify the tests for HAVE_ATOMIC_BUILTINS64 and HAVE__ATOMIC_BUILTINS64 such that the address for the atomic operations is not aligned (unless 64bit ints always have the suitable alignment, i.e. mainly 64bit systems..). Also, use the __atomic_always_lock_free() builtin to fail the test when the compiler already knows about the alignment issue (falling back to libatomic, which we don't require/want). With this, 64bit builtins should be selected only for platforms that can natively handle atomics on any apr_uin64_t (since the APR has no dedicated 8-byte aligned 64bit type for now), while the generic/mutex implementation is used for others. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1907642 13f79535-47bb-0310-9956-ffa450edef68
* atomic: No raw 64bit load/store on 32bit systems or anything but x86_64 or ↵ylavic2023-02-142-8/+10
| | | | | | | | | | | | | | | | | | | s390x. Raw 64 bit load and store need two intructions on 32bit systems (tearing) so they are not atomic, and only x86(_64) and s390(x) have stong mempry ordering guarantees. Always use builtin functions for the cases where raw load/store don't work as expected. * atomic/unix/builtins.c, atomic/unix/builtins64.c: Use an accept-list rather than a reject-list to define WEAK_MEMORY_ORDERING. Test APR_SIZEOF_VOIDP < 8 to force usage of __sync builtins for _read{32,64} and _set{32,64} on 32bit systems when __atomic_{load,store} buitlins are not available. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1907637 13f79535-47bb-0310-9956-ffa450edef68
* Re-order the fields of 'struct apr_bucket_file' to avoid a hole and some ↵jailletc362023-02-141-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | padding. Before the patch, pahole states that: struct apr_bucket_file { apr_bucket_refcount refcount; /* 0 4 */ /* XXX 4 bytes hole, try to pack */ apr_file_t * fd; /* 8 8 */ apr_pool_t * readpool; /* 16 8 */ int can_mmap; /* 24 4 */ /* XXX 4 bytes hole, try to pack */ apr_size_t read_size; /* 32 8 */ /* size: 40, cachelines: 1, members: 5 */ /* sum members: 32, holes: 2, sum holes: 8 */ /* last cacheline: 40 bytes */ }; git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1907634 13f79535-47bb-0310-9956-ffa450edef68
* * Since r1901037 Posix shared mem is prefered over SysV shared mem.rpluem2023-02-101-0/+7
| | | | | | | Add an option to revert this choice on systems that provide both. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1907566 13f79535-47bb-0310-9956-ffa450edef68
* apr_atomic: Generic apr_atomic_read64() needs a mutex on 32bit systems ↵ylavic2023-02-091-0/+19
| | | | | | | | | | | | | | | | (tearing). A 64bit load on a 32 bit CPU/system uses two instructions (tearing), so ensure atomicity with regard to other atomic functions by using the (same) lock. test_atomics_threaded64() fails because of this on 32bit systems. PR 66457. * atomic/unix/mutex64.c(apr_atomic_read64): Use locking when APR_SIZEOF_VOIDP < 8 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1907541 13f79535-47bb-0310-9956-ffa450edef68
* CHANGES: Fix typo.ivan2023-02-061-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1907467 13f79535-47bb-0310-9956-ffa450edef68
* Call apr__atomic_generic64_init() if neededsf2023-02-051-0/+4
| | | | | | | | | | | | | | | | | | | Otherwise we get a segfault. Seen on Debian on powerpc with /* Define if compiler provides 32bit atomic builtins */ #define HAVE_ATOMIC_BUILTINS 1 /* Define if compiler provides 64bit atomic builtins */ /* #undef HAVE_ATOMIC_BUILTINS64 */ /* Define if compiler provides 32bit __atomic builtins */ #define HAVE__ATOMIC_BUILTINS 1 /* Define if compiler provides 64bit __atomic builtins */ /* #undef HAVE__ATOMIC_BUILTINS64 */ /* Define if use of generic atomics is requested */ /* #undef USE_ATOMICS_GENERIC */ git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1907442 13f79535-47bb-0310-9956-ffa450edef68
* Try to use 64 bit __atomic builtins only when they are available.sf2023-02-051-8/+8
| | | | | | | | | | | | | | | | | | | | Otherwise we get link errors. Seen on Debian on armel and this configure result: /* Define if compiler provides 32bit atomic builtins */ #define HAVE_ATOMIC_BUILTINS 1 /* Define if compiler provides 64bit atomic builtins */ #define HAVE_ATOMIC_BUILTINS64 1 /* Define if compiler provides 32bit __atomic builtins */ #define HAVE__ATOMIC_BUILTINS 1 /* Define if compiler provides 64bit __atomic builtins */ /* #undef HAVE__ATOMIC_BUILTINS64 */ /* Define if use of generic atomics is requested */ /* #undef USE_ATOMICS_GENERIC */ git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1907441 13f79535-47bb-0310-9956-ffa450edef68
* Disable Travis since ASF support/sponsorship is ending. [skip ci]jorton2023-02-031-87/+0
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1907243 13f79535-47bb-0310-9956-ffa450edef68
* * memcache/apr_memcache.c (conn_connect): Allow use of IPv6jorton2023-02-031-4/+4
| | | | | | | | | | rather than forcing name resolution to IPv4 only. Submitted by: Lubos Uhliarik <luhliari redhat.com> Github: closes #39 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1907242 13f79535-47bb-0310-9956-ffa450edef68
* * shmem/unix/shm.c (apr_shm_open):jorton2023-01-231-14/+11
| | | | | | | | | | | | Use ftruncate() directly for the shm_open() path avoiding unnecessary complexity - and lseek() - of using apr_file_t wrapper. Also catch mmap() errors. PR: 66435 Github: closes #38 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1906947 13f79535-47bb-0310-9956-ffa450edef68
* * configure.in: Fix variable-length-array detection for recent gccjorton2023-01-231-1/+2
| | | | | | | | | | | with -Wall in CFLAGS, avoiding the "set but not used" warning: conftest.c: In function 'main': conftest.c:197:9: error: variable 'foo' set but not used [-Werror=unused-but-set-variable] 197 | int foo[argc]; git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1906946 13f79535-47bb-0310-9956-ffa450edef68
* Improve comment.ivan2023-01-231-2/+2
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1906943 13f79535-47bb-0310-9956-ffa450edef68
* Merge thread-name branch (PR 60587) [1]:ivan2023-01-2110-0/+256
| | | | | | | | | * Introduce apr_thread_name_set() and apr_thread_name_get(). [1] https://bz.apache.org/bugzilla/show_bug.cgi?id=60587 [2] https://lists.apache.org/thread/z24logzc6v8tc0p2q3375cc10qo9y5yw git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1906889 13f79535-47bb-0310-9956-ffa450edef68
* Follow-up to r1906885.ivan2023-01-211-12/+14
| | | | | | | | | * threadproc/win32/proc.c (apr_proc_create): Close redirect pipes only on success to match pre-r1906885 behavior. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1906888 13f79535-47bb-0310-9956-ffa450edef68
* Simplify code.ivan2023-01-211-3/+3
| | | | | | | | | * threadproc/win32/proc.c (apr_proc_create): Use apr_wchar_t for pEnvBlock local variable and avoid unnecessary casts. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1906887 13f79535-47bb-0310-9956-ffa450edef68
* Use sizeof(apr_wchar_t) instead of magic 2.ivan2023-01-211-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1906886 13f79535-47bb-0310-9956-ffa450edef68
* Fix potential handle leak when apr_proc_create() is used from from multipleivan2023-01-212-9/+18
| | | | | | | | | | | threads on Windows. * threadproc/win32/proc.c (apr_proc_create): Close our side of pipes before releasing lock: otherwise they could like to other process when apr_proc_create() is used from from multiple threads. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1906885 13f79535-47bb-0310-9956-ffa450edef68
* .github/workflows: Enable CI builds for tags.ivan2023-01-213-0/+3
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1906864 13f79535-47bb-0310-9956-ffa450edef68
* apr_proc_create(): Fix incorrect error handling when pipes are redirectedivan2023-01-212-6/+22
| | | | | | | | | | | on Windows. * threadproc/win32/proc.c (apr_proc_create): Save last error immediately after CreateProcessAsUserW()/ CreateProcessW() call, otherwise it can be lost by later calls. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1906863 13f79535-47bb-0310-9956-ffa450edef68
* force USE_SHMEM_SHMGET on AIXcovener2023-01-191-0/+4
| | | | | | | | | prior to r1901037 on trunk, USE_SHMEM_SHMGET is used. APR_USE_SHMEM_MMAP_SHM does not currently work on AIX. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1906825 13f79535-47bb-0310-9956-ffa450edef68
* bump copyright for 2023covener2023-01-192-2/+2
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1906809 13f79535-47bb-0310-9956-ffa450edef68
* Further strict C99 configure fix:jorton2023-01-171-1/+1
| | | | | | | | | | | | Avoid an implicit int in the definition of the main function. Avoids build problems with future C compilers which will not support them by default. Submitted by: Florian Weimer <fweimer redhat.com> PR: 66426 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1906723 13f79535-47bb-0310-9956-ffa450edef68
* testdbd is failing on MacOS, don't fail the job for this.jorton2023-01-111-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1906597 13f79535-47bb-0310-9956-ffa450edef68
* Fix further strict C99 compliance issue. (fixes #37)jorton2023-01-114-5/+28
| | | | | | | | PR: 66408 Submitted by: Sam James <sam gentoo.org> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1906594 13f79535-47bb-0310-9956-ffa450edef68
* Fix configure for compilers which don't accept implicitjorton2023-01-033-4/+4
| | | | | | | | | | int (no longer part of C since C99). Submitted by: Florian Weimer <fweimer redhat.com> PR: 66396 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1906347 13f79535-47bb-0310-9956-ffa450edef68
* By default use XmlLite on Windows.ivan2022-11-241-13/+3
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1905502 13f79535-47bb-0310-9956-ffa450edef68
* * CMakeLists.txt: Make CMAKE_MINIMUM_REQUIRED the first directive asivan2022-11-231-2/+4
| | | | | | | | required by CMake documentation [1] [1] https://cmake.org/cmake/help/latest/command/cmake_minimum_required.html git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1905493 13f79535-47bb-0310-9956-ffa450edef68
* CMakeLists.txt: Enable support for MSVC runtime library selection byivan2022-11-201-0/+6
| | | | | | | abstraction if supported by CMake. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1905416 13f79535-47bb-0310-9956-ffa450edef68
* .editorconfig: Configure C codestyle.ivan2022-11-201-0/+7
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1905415 13f79535-47bb-0310-9956-ffa450edef68
* Remove trailing whitespaces in *.c.ivan2022-11-20235-2111/+2111
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1905414 13f79535-47bb-0310-9956-ffa450edef68
* * .editorconfig: Configure trim_trailing_whitespace = true for all files.ivan2022-11-191-0/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1905408 13f79535-47bb-0310-9956-ffa450edef68
* Remove trailing whitespaces in all *.h.ivan2022-11-1980-816/+816
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1905407 13f79535-47bb-0310-9956-ffa450edef68
* * .editorconfig: Configure insert_final_newline = true for all files.ivan2022-11-191-0/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1905393 13f79535-47bb-0310-9956-ffa450edef68
* * poll/unix/wakeup.c: Add final newline.ivan2022-11-191-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1905392 13f79535-47bb-0310-9956-ffa450edef68
* Remove a useless variable that is shadowing another already existing one.jailletc362022-11-181-1/+0
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1905386 13f79535-47bb-0310-9956-ffa450edef68
* Revert r1904726: EXTRA_LIBS takes care of -lcrypt already in trunk.ylavic2022-10-201-2/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1904739 13f79535-47bb-0310-9956-ffa450edef68
* Following up on r1904715, rework the check to properly handle ankotkov2022-10-201-7/+2
| | | | | | | | | | overflow when apr_size_t is 32-bit long. * network_io/win32/sendrecv.c (apr_socket_sendv): As above. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1904734 13f79535-47bb-0310-9956-ffa450edef68
* configure: Link to libcrypt (when available) for apr_password_validate.ylavic2022-10-201-1/+2
| | | | | | | [Reverted by r1904739] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1904726 13f79535-47bb-0310-9956-ffa450edef68
* Win32: Stop apr_socket_sendv() from splitting iovecs into multiple possiblekotkov2022-10-201-31/+21
| | | | | | | | | | | | | | | | | | WSABUFs and error out on theoretical cases that cannot be handled with a single WSASend(). WSASend() returns the NumberOfBytesSent as DWORD, so the previous code that splitted overflowing iovecs never worked, as the total number of sent bytes cannot be properly represented by the API. So let's maintain a 1:1 relationship between the iovecs and WSABUFs, and error out on all inputs that exceed MAXDWORD. * network_io/win32/sendrecv.c (apr_socket_sendv): Remove the code that splits iovecs into WSABUFs. Check the sizes of all iovecs and the total size. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1904715 13f79535-47bb-0310-9956-ffa450edef68
* Revert r1902312, r1904699 in preparation for a slightly different change.kotkov2022-10-202-68/+26
| | | | | | | | | | | | Shortlog: - r1902312: apr_socket_sendv: WIN32: Limit the number of WSABUFs allocated for a single call. - r1904699: apr_socket_sendv: WIN32: Follow up to r1902312: Avoid short writes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1904714 13f79535-47bb-0310-9956-ffa450edef68
* apr_socket_sendv: WIN32: Follow up to r1902312: Avoid short writes.ylavic2022-10-192-30/+63
| | | | | | | | | | | | | | | | | | | | | | | | | We possibly (edge cases) can't send an entire iovec array in a single WSASend() call because structs WSABUF and iovec are ABI incompatible. To avoid breaking users that rely on full-write by apr_socket_sendv(), which supposedly is guaranteed by WSASend(), repeat the call until the given iovec array is exhausted. There is no way to provide both full-write and atomicity guarantees for apr_socket_sendv() on Windows, so we choose the former.. * include/apr_network_io.h: Document apr_socket_sendv() full-write/atomicity (non-)guarantees above the system ones. * network_io/win32/sendrecv.c(apr_socket_sendv): Change to a loop on WSASend() when needed, taking care of its API limits w.r.t. the given struct iovec. [Reverted by r1904714] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1904699 13f79535-47bb-0310-9956-ffa450edef68
* apr_base64: Follow up to r1902206: Cap to APR_BASE64_ENCODE_MAX in ↵ylavic2022-10-171-2/+2
| | | | | | apr_pbase64_encode(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1904666 13f79535-47bb-0310-9956-ffa450edef68
* * CMakeLists.txt: Add APR_BUILD_SHARED and APR_BUILD_STATIC options to controlivan2022-09-071-19/+39
| | | | | | | which configurations to build. Both are enabled by default. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1903912 13f79535-47bb-0310-9956-ffa450edef68
* apr_thread: Provide apr_threadattr_max_free_set().ylavic2022-07-1411-50/+74
| | | | | | | | | | | | | | | When creating a thread, this allows to specify the "max_free" of its pool allocator (i.e. apr_allocator_max_free_set), so that one can create thread local subpools and have their memory usage regulated on cleanup/destroy. One could achieve that already with: apr_allocator_max_free_set(apr_thread_pool_get(thread), max_free); in the thread startup function, but it's more convenient, simpler and race free to handle that in the thread attribute itself at creation time. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902715 13f79535-47bb-0310-9956-ffa450edef68