The BIND 9 memory model always requires a memory context to be used with
any functions that want to allocate memory. The BIND 9 memory allocator
has several advantages on top of default memory allocator (small-chunk
memory allocator, memory limits, statistics, memory tracking, ...), but
it also complicates some use scenarios:
* Integration our memory allocator with third party libraries that
usually requires standard memory functions (f.e. libuv requires malloc,
calloc, realloc and free to be available)
* Every single application using libisc has to create a memory context
first and then pass it to underlying functions
* Not even ever internal use case cares about the extra features and
would benefit from not having to track the memory allocator.
* Integration with external allocator libraries (tcmalloc, jemalloc)
is complicated and it mostly loses the benefits of said external
allocator by adding yet another layer(s) on top of it.
This commit uses the constructor/destructor attribute[1] with gcc/clang
and DllMain[2] with MSVC to create a default memory context that's
always available and adds isc_malloc(), isc_calloc(), isc_realloc(),
isc_free() and isc_strdup() set of functions that operates on top of the
default memory context.
1. https://gcc.gnu.org/onlinedocs/gcc-4.7.0/gcc/Function-Attributes.html
2. https://docs.microsoft.com/en-us/windows/win32/dlls/dllmain