<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/libatomic_ops.git/tests/test_stack.c, branch draft-coveralls-linux</title>
<subtitle>github.com: ivmai/libatomic_ops.git
</subtitle>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libatomic_ops.git/'/>
<entry>
<title>Revert "Fix test_atomic fail caused unaligned AO_double_t access (VC/x86)"</title>
<updated>2017-01-24T19:50:46+00:00</updated>
<author>
<name>Ivan Maidanski</name>
<email>ivmai@mail.ru</email>
</author>
<published>2017-01-24T14:49:58+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libatomic_ops.git/commit/?id=4949e9b8cb409288fcaa0553ead9704ca6219a23'/>
<id>4949e9b8cb409288fcaa0553ead9704ca6219a23</id>
<content type='text'>
This reverts commit 69c4010c1b3d43e2e179421e27379aaa5aeeb6d8.

The failure is actually caused by the fact that default alignment of
stack on x86 is 4 bytes.
So, another solution should be proposed to fix the issue for other
compilers (and, potentially, other targets).  E.g. do not place
AO_double_t volatile variables on stack.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 69c4010c1b3d43e2e179421e27379aaa5aeeb6d8.

The failure is actually caused by the fact that default alignment of
stack on x86 is 4 bytes.
So, another solution should be proposed to fix the issue for other
compilers (and, potentially, other targets).  E.g. do not place
AO_double_t volatile variables on stack.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix test_atomic failure caused unaligned AO_double_t access on x86 (VC++)</title>
<updated>2017-01-20T08:58:13+00:00</updated>
<author>
<name>Ivan Maidanski</name>
<email>ivmai@mail.ru</email>
</author>
<published>2017-01-20T08:58:13+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libatomic_ops.git/commit/?id=69c4010c1b3d43e2e179421e27379aaa5aeeb6d8'/>
<id>69c4010c1b3d43e2e179421e27379aaa5aeeb6d8</id>
<content type='text'>
Passing an unaligned AO_double_t pointer to AO double-wide primitives
results in an undefined behavior of the latter when running on x86 (or
violation of the corresponding assertion on the alignment).
MS VC++/x86 aligns AO_double_t values on a 4-byte boundary by default.
For the proper alignment, __declspec(align(8)) should be applied to
variables defined in the client code (which uses double-wide AO
primitives).  Unfortunately, the attribute cannot be added to
AO_double_t definition itself because the compiler does not allow the
attribute for function arguments.

This patch introduces AO_DOUBLE_ALIGN attribute for use by clients of
the double-wide AO primitives (and, thus, AO_stack clients).
Matters only Visual Studio compiler for X86.
The inner clients (atomic_ops_malloc, test_atomic, test_stack) are
updated to use this attribute.

* doc/README_win32.txt [x86] (AO_DOUBLE_ALIGN): Document.
* src/atomic_ops/sysdeps/generic_pthread.h (AO_DOUBLE_ALIGN): Define
(as empty).
* src/atomic_ops/sysdeps/standard_ao_double_t.h [!_WIN64 &amp;&amp; _WIN32
&amp;&amp; !__GNUC__ &amp;&amp; _MSC_VER] (AO_DOUBLE_ALIGN): Define as declspec
align(8); document it.
* src/atomic_ops/sysdeps/standard_ao_double_t.h [!AO_DOUBLE_ALIGN]
(AO_DOUBLE_ALIGN): Define as empty (otherwise).
* src/atomic_ops_stack.h [AO_USE_ALMOST_LOCK_FREE &amp;&amp; !AO_DOUBLE_ALIGN]
(AO_DOUBLE_ALIGN): Likewise.
* src/atomic_ops_malloc.c (AO_free_list): Use AO_DOUBLE_ALIGN attribute.
* tests/test_stack.c (the_list): Likewise.
* src/atomic_ops_stack.h [!AO_USE_ALMOST_LOCK_FREE] (AO_stack_t):
Document AO_DOUBLE_ALIGN usage (by clients).
* tests/test_atomic_include.template (test_atomicXX): Use
AO_DOUBLE_ALIGN attribute for old_w and w double-wide local variables
(to avoid alignment assertion violation or AO primitives undefined
behavior on x86 if the test code is compiled by VC++).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Passing an unaligned AO_double_t pointer to AO double-wide primitives
results in an undefined behavior of the latter when running on x86 (or
violation of the corresponding assertion on the alignment).
MS VC++/x86 aligns AO_double_t values on a 4-byte boundary by default.
For the proper alignment, __declspec(align(8)) should be applied to
variables defined in the client code (which uses double-wide AO
primitives).  Unfortunately, the attribute cannot be added to
AO_double_t definition itself because the compiler does not allow the
attribute for function arguments.

This patch introduces AO_DOUBLE_ALIGN attribute for use by clients of
the double-wide AO primitives (and, thus, AO_stack clients).
Matters only Visual Studio compiler for X86.
The inner clients (atomic_ops_malloc, test_atomic, test_stack) are
updated to use this attribute.

* doc/README_win32.txt [x86] (AO_DOUBLE_ALIGN): Document.
* src/atomic_ops/sysdeps/generic_pthread.h (AO_DOUBLE_ALIGN): Define
(as empty).
* src/atomic_ops/sysdeps/standard_ao_double_t.h [!_WIN64 &amp;&amp; _WIN32
&amp;&amp; !__GNUC__ &amp;&amp; _MSC_VER] (AO_DOUBLE_ALIGN): Define as declspec
align(8); document it.
* src/atomic_ops/sysdeps/standard_ao_double_t.h [!AO_DOUBLE_ALIGN]
(AO_DOUBLE_ALIGN): Define as empty (otherwise).
* src/atomic_ops_stack.h [AO_USE_ALMOST_LOCK_FREE &amp;&amp; !AO_DOUBLE_ALIGN]
(AO_DOUBLE_ALIGN): Likewise.
* src/atomic_ops_malloc.c (AO_free_list): Use AO_DOUBLE_ALIGN attribute.
* tests/test_stack.c (the_list): Likewise.
* src/atomic_ops_stack.h [!AO_USE_ALMOST_LOCK_FREE] (AO_stack_t):
Document AO_DOUBLE_ALIGN usage (by clients).
* tests/test_atomic_include.template (test_atomicXX): Use
AO_DOUBLE_ALIGN attribute for old_w and w double-wide local variables
(to avoid alignment assertion violation or AO primitives undefined
behavior on x86 if the test code is compiled by VC++).
</pre>
</div>
</content>
</entry>
<entry>
<title>Do not define print_list() unless used (tests)</title>
<updated>2016-11-14T20:09:57+00:00</updated>
<author>
<name>Ivan Maidanski</name>
<email>ivmai@mail.ru</email>
</author>
<published>2016-11-14T20:09:57+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libatomic_ops.git/commit/?id=239ea5f3e998ef4aca873aba5ac6668eaa252b35'/>
<id>239ea5f3e998ef4aca873aba5ac6668eaa252b35</id>
<content type='text'>
* tests/test_malloc.c (print_list): Define only if DEBUG_RUN_ONE_TEST.
* tests/test_stack.c (print_list): Define only if VERBOSE.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* tests/test_malloc.c (print_list): Define only if DEBUG_RUN_ONE_TEST.
* tests/test_stack.c (print_list): Define only if VERBOSE.
</pre>
</div>
</content>
</entry>
<entry>
<title>Eliminate 'ISO C90 does not support long long' compiler pedantic warning</title>
<updated>2016-10-12T06:35:55+00:00</updated>
<author>
<name>Ivan Maidanski</name>
<email>ivmai@mail.ru</email>
</author>
<published>2016-10-11T14:52:54+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libatomic_ops.git/commit/?id=53726beb93453583ce8413791dc731d1779e959d'/>
<id>53726beb93453583ce8413791dc731d1779e959d</id>
<content type='text'>
Long (32-bit) type is sufficient to represent time delta (duration)
in test_stack.

* tests/test_stack.c (get_msecs): Change return type from long long
to unsigned long (use lowest 32 bits of time value).
* tests/test_stack.c (main): Change type of start_time local variable
to unsigned long; remove redundant type cast.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Long (32-bit) type is sufficient to represent time delta (duration)
in test_stack.

* tests/test_stack.c (get_msecs): Change return type from long long
to unsigned long (use lowest 32 bits of time value).
* tests/test_stack.c (main): Change type of start_time local variable
to unsigned long; remove redundant type cast.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix missing printed value names (test_stack)</title>
<updated>2016-10-11T14:45:01+00:00</updated>
<author>
<name>Ivan Maidanski</name>
<email>ivmai@mail.ru</email>
</author>
<published>2016-10-11T14:45:01+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libatomic_ops.git/commit/?id=b4c949bb32e7021b70b399b31d8535cc7b437e1c'/>
<id>b4c949bb32e7021b70b399b31d8535cc7b437e1c</id>
<content type='text'>
* tests/test_stack.c [VERBOSE] (main): Print value name along with the
value itself; print "ms" for time value; remove extra get_msecs() call.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* tests/test_stack.c [VERBOSE] (main): Print value name along with the
value itself; print "ms" for time value; remove extra get_msecs() call.
</pre>
</div>
</content>
</entry>
<entry>
<title>Eliminate 'variable set but not used' Cppcheck warnings in test_stack</title>
<updated>2014-06-13T12:35:55+00:00</updated>
<author>
<name>Ivan Maidanski</name>
<email>ivmai@mail.ru</email>
</author>
<published>2014-06-13T12:35:55+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libatomic_ops.git/commit/?id=ba6c3170412ef7f751ff63e2b656296265dcff93'/>
<id>ba6c3170412ef7f751ff63e2b656296265dcff93</id>
<content type='text'>
* tests/test_stack.c (run_one_test): Define "j" local variable only
if VERBOSE.
* tests/test_stack.c (main): Do not define "sum" local variable (and
don not compute the sum) if NO_TIMES.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* tests/test_stack.c (run_one_test): Define "j" local variable only
if VERBOSE.
* tests/test_stack.c (main): Do not define "sum" local variable (and
don not compute the sum) if NO_TIMES.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix missing abort() usage in atomic_ops_malloc and tests on WinCE</title>
<updated>2013-01-07T08:31:48+00:00</updated>
<author>
<name>Ivan Maidanski</name>
<email>ivmai@mail.ru</email>
</author>
<published>2013-01-07T08:31:48+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libatomic_ops.git/commit/?id=9f4a38ec06a037a709e2324304c2f89b3f41e55a'/>
<id>9f4a38ec06a037a709e2324304c2f89b3f41e55a</id>
<content type='text'>
* src/atomic_ops_malloc.c (abort): Define to _exit(-1) if _WIN32_WCE
or __MINGW32CE__ (since there is no abort() in WinCE).
* tests/run_parallel.h (abort): Likewise.
* tests/test_stack.c (abort): Likewise.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/atomic_ops_malloc.c (abort): Define to _exit(-1) if _WIN32_WCE
or __MINGW32CE__ (since there is no abort() in WinCE).
* tests/run_parallel.h (abort): Likewise.
* tests/test_stack.c (abort): Likewise.
</pre>
</div>
</content>
</entry>
<entry>
<title>Improve debug printing in test_stack</title>
<updated>2012-12-09T06:29:54+00:00</updated>
<author>
<name>Thorsten Glaser</name>
<email>tg@mirbsd.de</email>
</author>
<published>2012-12-09T06:29:54+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libatomic_ops.git/commit/?id=649b0a0ddbff69ab0a044a4fdc9ac9cb0a9d5d76'/>
<id>649b0a0ddbff69ab0a044a4fdc9ac9cb0a9d5d76</id>
<content type='text'>
* tests/test_stack.c (main): Add debug printing of exper_n, nthreads,
max_nthreads and list_length before add_elements call (if VERBOSE).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* tests/test_stack.c (main): Add debug printing of exper_n, nthreads,
max_nthreads and list_length before add_elements call (if VERBOSE).
</pre>
</div>
</content>
</entry>
<entry>
<title>Adjust fprintf arguments type matching format specifier in test_stack</title>
<updated>2012-10-23T08:45:16+00:00</updated>
<author>
<name>Ivan Maidanski</name>
<email>ivmai@mail.ru</email>
</author>
<published>2012-10-23T03:33:34+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libatomic_ops.git/commit/?id=94c0b205a50f26339d2d77cbb9caeb999f9586cc'/>
<id>94c0b205a50f26339d2d77cbb9caeb999f9586cc</id>
<content type='text'>
* tests/test_stack.c (main): Cast "code" argument of fprintf calls to
unsigned int to match printf format specifier.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* tests/test_stack.c (main): Cast "code" argument of fprintf calls to
unsigned int to match printf format specifier.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix variable type to match printf format specifier in test_stack</title>
<updated>2012-10-08T20:06:19+00:00</updated>
<author>
<name>Ivan Maidanski</name>
<email>ivmai@mail.ru</email>
</author>
<published>2012-10-08T20:06:19+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libatomic_ops.git/commit/?id=1b3c02cfe3214e4d91314d4eec2ca9d28aa58cc3'/>
<id>1b3c02cfe3214e4d91314d4eec2ca9d28aa58cc3</id>
<content type='text'>
* tests/test_stack.c (run_one_test): Change type of "index" local
variable from long to int to match printf format specifier (when
VERBOSE defined); cast from "arg" pointer to integer via size_t (to
avoid 64-bit compiler warning).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* tests/test_stack.c (run_one_test): Change type of "index" local
variable from long to int to match printf format specifier (when
VERBOSE defined); cast from "arg" pointer to integer via size_t (to
avoid 64-bit compiler warning).
</pre>
</div>
</content>
</entry>
</feed>
