"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/source/wintls.cpp" between
Hoard-3.12.tar.gz and Hoard-3.13.tar.gz

About: The Hoard memory allocator is a drop-in replacement for malloc() that can improve application performance, especially for multithreaded programs running on multiprocessors (hint: newer releases now part of the HeapLayers package).

wintls.cpp  (Hoard-3.12):wintls.cpp  (Hoard-3.13)
// -*- C++ -*- // -*- C++ -*-
/* /*
The Hoard Multiprocessor Memory Allocator The Hoard Multiprocessor Memory Allocator
www.hoard.org www.hoard.org
Author: Emery Berger, http://www.emeryberger.org Author: Emery Berger, http://www.emeryberger.org
Copyright (c) 1998-2015 Emery Berger Copyright (c) 1998-2019 Emery Berger
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
skipping to change at line 44 skipping to change at line 44
*/ */
#if defined(_WIN32) #if defined(_WIN32)
#include <new> #include <new>
#pragma warning(disable: 4447) // Disable weird warning about threading model. #pragma warning(disable: 4447) // Disable weird warning about threading model.
// Windows TLS functions. // Windows TLS functions.
#include "VERSION.h" #include "VERSION.h"
#define versionMessage "Using the Hoard memory allocator (http://www.hoard.org),
version " HOARD_VERSION_STRING "\n"
#include "hoardheap.h" #include "hoardheap.h"
#include "hoardtlab.h" #include "hoardtlab.h"
using namespace Hoard; using namespace Hoard;
#define USE_DECLSPEC_THREADLOCAL 0 #define USE_DECLSPEC_THREADLOCAL 0
#if USE_DECLSPEC_THREADLOCAL #if USE_DECLSPEC_THREADLOCAL
__declspec(thread) TheCustomHeapType * threadLocalHeap = NULL; __declspec(thread) TheCustomHeapType * threadLocalHeap = NULL;
#else #else
skipping to change at line 114 skipping to change at line 117
// Intercept thread creation and destruction to flush the TLABs. // Intercept thread creation and destruction to flush the TLABs.
// //
extern "C" { extern "C" {
BOOL APIENTRY DllMain (HANDLE hinstDLL, BOOL APIENTRY DllMain (HANDLE hinstDLL,
DWORD fdwReason, DWORD fdwReason,
LPVOID lpreserved) LPVOID lpreserved)
{ {
static int np = HL::CPUInfo::computeNumProcessors(); static int np = HL::CPUInfo::computeNumProcessors();
switch (fdwReason) { switch (fdwReason) {
case DLL_PROCESS_ATTACH: case DLL_PROCESS_ATTACH:
{ {
// fprintf (stderr, "Using the Hoard scalable memory manager (http:/ /www.hoard.org).\n"); fprintf (stderr, versionMessage);
InitializeWinWrapper(); InitializeWinWrapper();
getCustomHeap(); getCustomHeap();
} }
break; break;
case DLL_THREAD_ATTACH: case DLL_THREAD_ATTACH:
if (np == 1) { if (np == 1) {
// We have exactly one processor - just assign the thread to // We have exactly one processor - just assign the thread to
// heap 0. // heap 0.
getMainHoardHeap()->chooseZero(); getMainHoardHeap()->chooseZero();
 End of changes. 4 change blocks. 
3 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)