Commit Graph

9 Commits (4f00a13f5ea9bea712a0313562a86cbff07342ad)

Author SHA1 Message Date
Andrey Lihatskiy 1b68f71348 #824 Process source files in bulk: replace tabs with spaces, convert CRLF to LF, and trim trailing whitespaces as needed 2024-04-29 07:56:09 +03:00
Nat Goodspeed 2902f23a41 DRTVWR-476: Remove special llcorehttp test memory manager.
NickyD discovered that the substitute default allocator used for llcorehttp
tests was returning badly-aligned storage, which caused access violations on
alignment-sensitive data such as std::atomic. Thanks Nicky!!

Moreover, the llcorehttp test assertions regarding memory usage, well-
intentioned though they are, have been causing us trouble for years. Many have
already been disabled.

The problem is that use of test_allocator.h affected *everything* defined with
that header file's declarations visible. That inevitably included specific
functions in other subsystems. Those functions then (unintentionally) consumed
the special allocator, throwing off the memory tracking and making certain
memory-related assertions consistently fail.

This is a particular, observable bad effect of One Definition Rule violations.
Within a given program, C++ allows multiple definitions for the same entity,
but requires that all such definitions be the same. Partial visibility of the
global operator new() and operator delete() overrides meant that some
definitions of certain entities used the default global allocator, some used
llcorehttp's. There may have been other, more subtle bad effects of these ODR
violations.

If one wanted to reimplement verification of the memory consumption of
llcorehttp classes:

* Each llcorehttp class (for which memory tracking was desired) should declare
  class-specific operator new() and operator delete() methods. Naturally,
  these would all consume a central llcorehttp-specific allocator, but that
  allocator should *not* be named global operator new().
* Presumably that would require runtime indirection to allow using the default
  allocator in production while substituting the special allocator for tests.
* Recording and verifying the memory consumption in each test should be
  performed in the test-object constructor and destructor, rather than being
  sprinkled throughout the test<n>() methods.
* With that mechanism in place, the test object should provide methods to
  adjust (or entirely disable) memory verification for a particular test.
* The test object should also provide a "yes, we're still consuming llcorehttp
  memory" method to be used for spot checks in the middle of tests -- instead
  of sprinkling in explicit comparisons as before.
* In fact, the llcorehttp test object in each test_*.hpp file should be
  derived from a central llcorehttp test-object base class providing those
  methods.
2020-03-25 18:44:04 -04:00
Oz Linden 9be58e915a merge with 4.0.3-release 2016-04-04 15:53:09 -04:00
Oz Linden c8726aba30 remove execute permission from many files that should not have it 2015-11-10 09:48:56 -05:00
Rider Linden 7ff38e34ea Update the unit tests to use the new pointer type. 2015-07-08 12:44:57 -07:00
Monty Brandenberg 4eef1c8a2e SH-4106 Significantly upgrade the HttpHeaders interface for SSB.
Header container moves from a vector of raw lines to a vector
of string pairs representing name/value pairs in headers.  For
incoming headers, we normalize the name to lowercase and trim
it.  Values are only left-trimmed.  Outgoing headers are left
as-is.  Simple find() method for the common case, forward and
reverse iterators for those few who need to do it themselves.
The HTTP status line (e.g. 'HTTP/1.1 200 Ok') is no longer treated
as a header to be returned to caller.  Unit tests, as usual,
were a bear but they absolutely ensured outgoing HTTP header
conformance after the change.  Grunt work paid off.

LLTextureFetch was also given a second options structure
for texture fetches.  Same as the original but with header return
to caller requested.  Baked textures should use this, the other
20,000 texture fetch requests should continue to use the original.
2013-04-15 16:55:35 +00:00
Graham Madarasz bf6182daa8 Update Mac and Windows breakpad builds to latest 2013-03-29 07:50:08 -07:00
Monty Brandenberg 74d59e7128 Build llcorehttp as part of a viewer dependency with unit tests. This required
boost::thread and the easiest path to that was to go with the 1.48 Boost release
in the 3P tree (eliminating a fork for a modified 1.45 packaging).  One unit test,
the most important one, is failing in test_httprequest but that can be attended
to later.  This test issues a GET to http://localhost:2/ and that is hitting the
wire but the libcurl plumbing isn't delivering the failure, only the eventual
timeout.  An unexpected change in behavior.
2012-05-07 15:16:31 -04:00
Monty Brandenberg 5611cb6d47 Okay, imported the core-http library and got it compiling suspiciously easily.
The unit/integration tests don't work yet as I'm still battling cmake/autobuild
as usual but first milestone passed.
2012-04-23 16:19:39 -04:00