1 // $Id: fixmem.h 900 2006-04-26 15:06:27Z gerry $
2 /* @@tag:xara-cn@@ DO NOT MODIFY THIS LINE
3 ================================XARAHEADERSTART===========================
5 Xara LX, a vector drawing and manipulation program.
6 Copyright (C) 1993-2006 Xara Group Ltd.
7 Copyright on certain contributions may be held in joint with their
8 respective authors. See AUTHORS file for details.
10 LICENSE TO USE AND MODIFY SOFTWARE
11 ----------------------------------
13 This file is part of Xara LX.
15 Xara LX is free software; you can redistribute it and/or modify it
16 under the terms of the GNU General Public License version 2 as published
17 by the Free Software Foundation.
19 Xara LX and its component source files are distributed in the hope
20 that it will be useful, but WITHOUT ANY WARRANTY; without even the
21 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
22 See the GNU General Public License for more details.
24 You should have received a copy of the GNU General Public License along
25 with Xara LX (see the file GPL in the root directory of the
26 distribution); if not, write to the Free Software Foundation, Inc., 51
27 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
33 Conditional upon your continuing compliance with the GNU General Public
34 License described above, Xara Group Ltd grants to you certain additional
37 The additional rights are to use, modify, and distribute the software
38 together with the wxWidgets library, the wxXtra library, and the "CDraw"
39 library and any other such library that any version of Xara LX relased
40 by Xara Group Ltd requires in order to compile and execute, including
41 the static linking of that library to XaraLX. In the case of the
42 "CDraw" library, you may satisfy obligation under the GNU General Public
43 License to provide source code by providing a binary copy of the library
44 concerned and a copy of the license accompanying it.
46 Nothing in this section restricts any of the rights you have under
47 the GNU General Public License.
53 This license applies to this program (XaraLX) and its constituent source
54 files only, and does not necessarily apply to other Xara products which may
55 in part share the same code base, and are subject to their own licensing
58 This license does not apply to files in the wxXtra directory, which
59 are built into a separate library, and are subject to the wxWindows
60 license contained within that directory in the file "WXXTRA-LICENSE".
62 This license does not apply to the binary libraries (if any) within
63 the "libs" directory, which are subject to a separate license contained
64 within that directory in the file "LIBS-LICENSE".
67 ARRANGEMENTS FOR CONTRIBUTION OF MODIFICATIONS
68 ----------------------------------------------
70 Subject to the terms of the GNU Public License (see above), you are
71 free to do whatever you like with your modifications. However, you may
72 (at your option) wish contribute them to Xara's source tree. You can
73 find details of how to do this at:
74 http://www.xaraxtreme.org/developers/
76 Prior to contributing your modifications, you will need to complete our
77 contributor agreement. This can be found at:
78 http://www.xaraxtreme.org/developers/contribute/
80 Please note that Xara will not accept modifications which modify any of
81 the text between the start and end of this header (marked
82 XARAHEADERSTART and XARAHEADEREND).
88 Xara, Xara LX, Xara X, Xara X/Xtreme, Xara Xtreme, the Xtreme and Xara
89 designs are registered or unregistered trademarks, design-marks, and/or
90 service marks of Xara Group Ltd. All rights in these marks are reserved.
93 Xara Group Ltd, Gaddesden Place, Hemel Hempstead, HP2 6EX, UK.
96 =================================XARAHEADEREND============================
99 // header file for fixed memory allocator
107 // the Tuned memory manager
112 void DumpCCMallocTrace(void);
114 LPVOID
DebugCCMalloc( size_t Size
, LPCSTR Filename
, INT32 Line
);
115 LPVOID
DebugCCRealloc( LPVOID Buf
, size_t Size
, LPCSTR Filename
, INT32 Line
);
116 size_t DebugCCGetBlockSize(LPVOID Buf
);
117 #define CCMalloc(size) DebugCCMalloc((size), THIS_FILE, __LINE__)
118 #define CCRealloc(buf, size) DebugCCRealloc((buf), (size), THIS_FILE, __LINE__)
119 #define CCGetBlockSize(buf) DebugCCGetBlockSize(buf);
123 LPVOID
RetailCCMalloc( UINT32 size
);
124 LPVOID
RetailCCRealloc( LPVOID buf
, UINT32 size
);
125 size_t RetailCCGetBlockSize(LPVOID Buf
);
127 #define CCMalloc(size) RetailCCMalloc( (size) )
128 #define CCRealloc(buf, size) RetailCCRealloc((buf), (size))
129 #define CCGetBlockSize(buf) RetailCCGetBlockSize(buf);
133 void CCFree( LPVOID buf
);
136 #if !defined(EXCLUDE_FROM_XARLIB)
137 TunedMemory
* GetTunedMemManager();
140 class CCMallocCriticalSection
143 CCMallocCriticalSection()
147 ::EnterCriticalSection(&sm_Section
);
151 ~CCMallocCriticalSection()
154 ::LeaveCriticalSection(&sm_Section
);
163 ::InitializeCriticalSection(&sm_Section
);
174 ::DeleteCriticalSection(&sm_Section
);
183 static CRITICAL_SECTION sm_Section
;
184 static BOOL sm_bInit
;