| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1907718 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(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
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1907467 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1907243 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1906943 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1906886 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1906864 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1906809 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1906597 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1905502 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
abstraction if supported by CMake.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1905416 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1905415 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1905414 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1905408 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1905407 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1905393 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1905392 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1905386 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1904739 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
[Reverted by r1904739]
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1904726 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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_pbase64_encode().
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1904666 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|