1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +03:00

0022815: Missing delete operator for placement new

This commit is contained in:
dbv 2012-03-06 12:32:06 +04:00 committed by bugmaster
parent 59f45b7cef
commit 1c35b92f5f
115 changed files with 280 additions and 868 deletions

View File

@ -25,6 +25,9 @@
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_DefineAlloc_HeaderFile
#include <Standard_DefineAlloc.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
@ -76,18 +79,7 @@ class BRepExtrema_DistShapeShape
{
public:
void* operator new(size_t,void* anAddress)
{
return anAddress;
}
void* operator new(size_t size)
{
return Standard::Allocate(size);
}
void operator delete(void *anAddress)
{
if (anAddress) Standard::Free((Standard_Address&)anAddress);
}
DEFINE_STANDARD_ALLOC
//! create empty tool <br>
Standard_EXPORT BRepExtrema_DistShapeShape();

View File

@ -25,6 +25,9 @@
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_DefineAlloc_HeaderFile
#include <Standard_DefineAlloc.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
@ -60,18 +63,7 @@ class BRepExtrema_DistanceSS
{
public:
void* operator new(size_t,void* anAddress)
{
return anAddress;
}
void* operator new(size_t size)
{
return Standard::Allocate(size);
}
void operator delete(void *anAddress)
{
if (anAddress) Standard::Free((Standard_Address&)anAddress);
}
DEFINE_STANDARD_ALLOC
//! computes the distance between two Shapes ( face edge vertex). <br>
Standard_EXPORT BRepExtrema_DistanceSS(const TopoDS_Shape& S1, const TopoDS_Shape& S2,

View File

@ -9,6 +9,9 @@
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_DefineAlloc_HeaderFile
#include <Standard_DefineAlloc.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
@ -37,18 +40,7 @@ class BRepExtrema_ExtCC
{
public:
void* operator new(size_t,void* anAddress)
{
return anAddress;
}
void* operator new(size_t size)
{
return Standard::Allocate(size);
}
void operator delete(void *anAddress)
{
if (anAddress) Standard::Free((Standard_Address&)anAddress);
}
DEFINE_STANDARD_ALLOC
Standard_EXPORT BRepExtrema_ExtCC()
{

View File

@ -9,6 +9,9 @@
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_DefineAlloc_HeaderFile
#include <Standard_DefineAlloc.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
@ -53,18 +56,7 @@ class BRepExtrema_ExtCF
{
public:
void* operator new(size_t,void* anAddress)
{
return anAddress;
}
void* operator new(size_t size)
{
return Standard::Allocate(size);
}
void operator delete(void *anAddress)
{
if (anAddress) Standard::Free((Standard_Address&)anAddress);
}
DEFINE_STANDARD_ALLOC
Standard_EXPORT BRepExtrema_ExtCF()
{

View File

@ -9,6 +9,9 @@
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_DefineAlloc_HeaderFile
#include <Standard_DefineAlloc.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
@ -47,19 +50,7 @@ class BRepExtrema_ExtFF
{
public:
void* operator new(size_t,void* anAddress)
{
return anAddress;
}
void* operator new(size_t size)
{
return Standard::Allocate(size);
}
void operator delete(void *anAddress)
{
if (anAddress) Standard::Free((Standard_Address&)anAddress);
}
DEFINE_STANDARD_ALLOC
Standard_EXPORT BRepExtrema_ExtFF()
{

View File

@ -9,6 +9,9 @@
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_DefineAlloc_HeaderFile
#include <Standard_DefineAlloc.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
@ -38,19 +41,7 @@ class BRepExtrema_ExtPC
{
public:
void* operator new(size_t,void* anAddress)
{
return anAddress;
}
void* operator new(size_t size)
{
return Standard::Allocate(size);
}
void operator delete(void *anAddress)
{
if (anAddress) Standard::Free((Standard_Address&)anAddress);
}
DEFINE_STANDARD_ALLOC
Standard_EXPORT BRepExtrema_ExtPC()
{

View File

@ -25,6 +25,9 @@
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_DefineAlloc_HeaderFile
#include <Standard_DefineAlloc.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
@ -65,18 +68,7 @@ class BRepExtrema_ExtPF
{
public:
void* operator new(size_t,void* anAddress)
{
return anAddress;
}
void* operator new(size_t size)
{
return Standard::Allocate(size);
}
void operator delete(void *anAddress)
{
if (anAddress) Standard::Free((Standard_Address&)anAddress);
}
DEFINE_STANDARD_ALLOC
Standard_EXPORT BRepExtrema_ExtPF()
{}

View File

@ -9,6 +9,9 @@
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_DefineAlloc_HeaderFile
#include <Standard_DefineAlloc.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
@ -43,20 +46,8 @@ class BRepExtrema_SolutionElem
{
public:
void* operator new(size_t,void* anAddress)
{
return anAddress;
}
void* operator new(size_t size)
{
return Standard::Allocate(size);
}
void operator delete(void *anAddress)
{
if (anAddress) Standard::Free((Standard_Address&)anAddress);
}
DEFINE_STANDARD_ALLOC
Standard_EXPORT BRepExtrema_SolutionElem()
: myDist(0.), myPoint(0.,0.,0.), mySupType(BRepExtrema_IsVertex), myPar1(0.), myPar2(0.)
{

View File

@ -57,6 +57,9 @@ class gp_Pnt2d;
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_DefineAlloc_HeaderFile
#include <Standard_DefineAlloc.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
@ -65,18 +68,8 @@ class BRepPrim_OneAxis {
public:
void* operator new(size_t,void* anAddress)
{
return anAddress;
}
void* operator new(size_t size)
{
return Standard::Allocate(size);
}
void operator delete(void *anAddress)
{
if (anAddress) Standard::Free((Standard_Address&)anAddress);
}
DEFINE_STANDARD_ALLOC
// Methods PUBLIC
//
Standard_EXPORT virtual void Delete() ;

View File

@ -64,6 +64,9 @@ class BRepSweep_SequenceNodeOfSequenceOfShapesOfNumLinearRegularSweep;
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_DefineAlloc_HeaderFile
#include <Standard_DefineAlloc.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
@ -72,18 +75,8 @@ class BRepSweep_NumLinearRegularSweep {
public:
void* operator new(size_t,void* anAddress)
{
return anAddress;
}
void* operator new(size_t size)
{
return Standard::Allocate(size);
}
void operator delete(void *anAddress)
{
if (anAddress) Standard::Free((Standard_Address&)anAddress);
}
DEFINE_STANDARD_ALLOC
// Methods PUBLIC
//
Standard_EXPORT virtual void Delete() ;

View File

@ -38,7 +38,7 @@ DBC_VArray::DBC_VArray(const Standard_Integer Size) : DBC_BaseArray(Size)
if(Size > 0) {
#endif
#ifdef CSFDB
myData = (DBC_VArrayTNode*)StandardCSFDB_Allocate(Size * sizeof(DBC_VArrayTNode));
myData = (DBC_VArrayTNode*)Standard::Allocate(Size * sizeof(DBC_VArrayTNode));
DBC_VArrayTNode* ptrtmp = (DBC_VArrayTNode*)myData;
for (int i = 0; i < Size; i++) {
ptrtmp = new((Standard_Address)ptrtmp) DBC_VArrayTNode();
@ -69,7 +69,7 @@ DBC_VArray::DBC_VArray(const DBC_VArray& Varray) : DBC_BaseArray(Varray)
#ifdef CSFDB
//myData = new DBC_VArrayTNode[mySize];
myData = (DBC_VArrayTNode*)StandardCSFDB_Allocate(mySize * sizeof(DBC_VArrayTNode));
myData = (DBC_VArrayTNode*)Standard::Allocate(mySize * sizeof(DBC_VArrayTNode));
DBC_VArrayTNode* ptrtmp = (DBC_VArrayTNode*)myData;
for(Standard_Integer i=0; i<mySize; i++) {
@ -143,7 +143,7 @@ void DBC_VArray::Resize (const Standard_Integer NewSize)
DBC_VArrayTNode* ptr = 0L;
if(NewSize) {
ptr = (DBC_VArrayTNode*)StandardCSFDB_Allocate(NewSize * sizeof(DBC_VArrayTNode));
ptr = (DBC_VArrayTNode*)Standard::Allocate(NewSize * sizeof(DBC_VArrayTNode));
}
DBC_VArrayTNode* ptrtmp = ptr;
@ -162,8 +162,7 @@ void DBC_VArray::Resize (const Standard_Integer NewSize)
ptrtmp->DBC_VArrayTNode::~DBC_VArrayTNode();
ptrtmp++;
}
// StandardCSFDB_Free((Standard_Address&)myData,mySize * sizeof(DBC_VArrayTNode));
StandardCSFDB_Free((Standard_Address&)myData);
Standard::Free((Standard_Address&)myData);
} else {
for(i = 0; i < NewSize; i++) {
ptrtmp = new((Standard_Address)ptrtmp) DBC_VArrayTNode();
@ -278,8 +277,7 @@ void DBC_VArray::Destroy()
ptrtmp->DBC_VArrayTNode::~DBC_VArrayTNode();
ptrtmp++;
}
// StandardCSFDB_Free((Standard_Address&)myData,mySize * sizeof(DBC_VArrayTNode));
StandardCSFDB_Free((Standard_Address&)myData);
Standard::Free((Standard_Address&)myData);
myData = 0L;
}
#endif

View File

@ -14,7 +14,7 @@ struct _degeneration
{
int mode;
float skipRatio;
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
typedef _degeneration DEGENERATION;
typedef _degeneration* PDEGENERATION;
@ -28,7 +28,7 @@ struct _ds_internal
int model;
float skipRatio;
unsigned char* bDraw;
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
typedef _ds_internal DS_INTERNAL;
typedef _ds_internal* PDS_INTERNAL;

View File

@ -14,45 +14,14 @@ for InterfaceGraphic_Parray.hxx definitions
#define INTERFACEGRAPHIC_TELEM_H
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <InterfaceGraphic_tgl_all.hxx>
#include <stdlib.h>
//if SUN compiler
#if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x530) && ! defined(typename)
#define IMPLEMENT_MEMORY_OPERATORS \
void* operator new (size_t size) {\
void* p = malloc( size );\
memset(p, 0, size);\
return p;\
}\
void operator delete(void* p) {\
free( p );\
}
#else
//if other
#define IMPLEMENT_MEMORY_OPERATORS \
void* operator new (size_t size) {\
void* p = malloc( size );\
memset(p, 0, size);\
return p;\
}\
void* operator new[] (size_t size) {\
void* p = malloc( size );\
memset(p, 0, size);\
return p;\
}\
void operator delete(void* p) { \
free( p );\
}\
void operator delete[](void* p) {\
free( p );\
}
#endif
struct TEL_TEXTURE_COORD
{
float xy[2];
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
typedef TEL_TEXTURE_COORD* tel_texture_coord;
@ -60,23 +29,7 @@ typedef TEL_TEXTURE_COORD* tel_texture_coord;
struct TEL_POINT
{
float xyz[3];
IMPLEMENT_MEMORY_OPERATORS
/*void* operator new (size_t size) {
void* p = malloc( size );
memset(p, 0, size);
return p;
}
void* operator new[] (size_t size) {
void* p = malloc( size );
memset(p, 0, size);
return p;
}
void operator delete(void* p) {
free( p );
}
void operator delete[](void* p) {
free( p );
}*/
DEFINE_STANDARD_ALLOC
};
typedef TEL_POINT* tel_point;
@ -84,7 +37,7 @@ struct TEL_COLOUR
{
/* OCC8854: san -- number of color components increased to include alpha value */
float rgb[4];
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
typedef TEL_COLOUR* tel_colour;
@ -92,7 +45,7 @@ struct TEL_POINT_DATA
{
int num;
TEL_POINT* data;
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
typedef TEL_POINT_DATA* tel_point_data;
@ -100,7 +53,7 @@ struct TEL_TINT_DATA
{
int num;
int* data;
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
typedef TEL_TINT_DATA* tel_tint_data;
@ -108,7 +61,7 @@ struct TEL_MATRIX3_DATA
{
TComposeType mode;
Tmatrix3 mat;
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
typedef TEL_MATRIX3_DATA* tel_matrix3_data;
@ -116,7 +69,7 @@ struct TEL_ALIGN_DATA
{
Tint Hmode;
Tint Vmode;
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
typedef TEL_ALIGN_DATA* tel_align_data;
@ -149,7 +102,7 @@ struct TEL_SURF_PROP
int isamb, isdiff, isspec, isemsv;
int isphysic;
TEL_COLOUR speccol, difcol, ambcol, emscol, matcol;
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
typedef TEL_SURF_PROP* tel_surf_prop;
@ -304,7 +257,7 @@ struct TEL_POFFSET_PARAM
int mode;
float factor;
float units;
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
typedef TEL_POFFSET_PARAM* tel_poffset_param;
/* OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets */
@ -316,7 +269,7 @@ struct TEL_TRANSFORM_PERSISTENCE
float pointX;
float pointY;
float pointZ;
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
typedef TEL_TRANSFORM_PERSISTENCE* tel_transform_persistence;
/* ABD 29/10/04 Transform Persistence of Presentation( pan, zoom, rotate ) */

View File

@ -7,11 +7,6 @@
#include <LDOM_BasicAttribute.hxx>
#include <LDOM_MemManager.hxx>
#ifdef WNT
// Disable the warning: "operator new unmatched by delete"
#pragma warning (disable:4291)
#endif
//=======================================================================
//function : LDOM_BasicAttribute
//purpose :

View File

@ -15,20 +15,12 @@ class LDOM_Element;
class LDOM_Attr;
class LDOM_Node;
#ifdef WNT
// Disable the warning: "operator new unmatched by delete"
#pragma warning (push)
#pragma warning (disable:4291)
#endif
// Class LDOM_BasicAttribute
//
class LDOM_BasicAttribute : public LDOM_BasicNode
{
public:
void * operator new (size_t, void * anAddress) { return anAddress; }
// ---------- PUBLIC METHODS ----------
LDOM_BasicAttribute () : LDOM_BasicNode (LDOM_Node::UNKNOWN) {}
@ -72,8 +64,4 @@ class LDOM_BasicAttribute : public LDOM_BasicNode
LDOMBasicString myValue;
};
#ifdef WNT
#pragma warning (pop)
#endif
#endif

View File

@ -9,11 +9,6 @@
#include <LDOM_BasicText.hxx>
#include <LDOM_MemManager.hxx>
#ifdef WNT
// Disable the warning: "operator new unmatched by delete"
#pragma warning (disable:4291)
#endif
//=======================================================================
//function : Create
//purpose : construction in the Document's data pool

View File

@ -17,19 +17,12 @@ class LDOM_NodeList;
class LDOM_Element;
class LDOM_BasicAttribute;
#ifdef WNT
// Disable the warning: "operator new unmatched by delete"
#pragma warning (push)
#pragma warning (disable:4291)
#endif
// Class LDOM_BasicElement
//
class LDOM_BasicElement : public LDOM_BasicNode
{
public:
void * operator new (size_t, void * anAddress) { return anAddress; }
// ---------- PUBLIC METHODS ----------
@ -128,8 +121,4 @@ class LDOM_BasicElement : public LDOM_BasicNode
LDOM_BasicNode * myFirstChild;
};
#ifdef WNT
#pragma warning (pop)
#endif
#endif

View File

@ -18,6 +18,9 @@ class LDOMParser;
class LDOM_BasicNode
{
public:
DEFINE_STANDARD_ALLOC
public:
Standard_Boolean isNull () const {return myNodeType ==LDOM_Node::UNKNOWN;}

View File

@ -8,11 +8,6 @@
#include <LDOM_BasicText.hxx>
#include <LDOM_MemManager.hxx>
#ifdef WNT
// Disable the warning: "operator new unmatched by delete"
#pragma warning (disable:4291)
#endif
//=======================================================================
//function : LDOM_BasicText()
//purpose : Constructor

View File

@ -15,19 +15,12 @@ class LDOM_CharacterData;
class LDOMParser;
class LDOM_BasicElement;
#ifdef WNT
// Disable the warning: "operator new unmatched by delete"
#pragma warning (push)
#pragma warning (disable:4291)
#endif
// Class LDOM_BasicText
//
class LDOM_BasicText : public LDOM_BasicNode
{
public:
void * operator new (size_t, void * anAddress) { return anAddress; }
// ---------- PUBLIC METHODS ----------
@ -69,8 +62,4 @@ class LDOM_BasicText : public LDOM_BasicNode
LDOMBasicString myValue;
};
#ifdef WNT
#pragma warning (pop)
#endif
#endif

View File

@ -79,6 +79,6 @@ NCollection_Comparator.hxx
NCollection_QuickSort.hxx
NCollection_Haft.h
NCollection_DefaultHasher.hxx
NCollection_DefineAlloc.hxx
NCollection_DefaultHasher.hxx

View File

@ -15,12 +15,6 @@
#include <NCollection_BaseCollection.hxx>
#ifdef WNT
// Disable the warning "operator new unmatched by delete"
#pragma warning (push)
#pragma warning (disable:4291)
#endif
// *********************************************** Template for Array1 class
/**
@ -86,10 +80,6 @@ template <class TheItemType> class NCollection_Array1
//! Variable value access
virtual TheItemType& ChangeValue (void) const
{ return myArray->ChangeValue(myCurrent); }
//! Operator new for allocating iterators
void* operator new(size_t theSize,
const Handle(NCollection_BaseAllocator)& theAllocator)
{ return theAllocator->Allocate(theSize); }
private:
Standard_Integer myCurrent; //!< Index of the current item
NCollection_Array1* myArray; //!< Pointer to the array being iterated
@ -277,8 +267,4 @@ template <class TheItemType> class NCollection_Array1
TheItemType* myData; //!< Pointer to '0'th array item
};
#ifdef WNT
#pragma warning (pop)
#endif
#endif

View File

@ -15,11 +15,6 @@
#include <NCollection_BaseCollection.hxx>
#ifdef WNT
// Disable the warning "operator new unmatched by delete"
#pragma warning (disable:4291)
#endif
// *********************************************** Template for Array2 class
/**
* Purpose: The class Array2 represents bi-dimensional arrays
@ -70,10 +65,6 @@ template <class TheItemType> class NCollection_Array2
//! Variable value access
virtual TheItemType& ChangeValue (void) const
{ return myArray->myStart[myCurrent]; }
//! Operator new for allocating iterators
void* operator new(size_t theSize,
const Handle(NCollection_BaseAllocator)& theAllocator)
{ return theAllocator->Allocate(theSize); }
private:
Standard_Integer myCurrent; //!< Index of the current item
Standard_Integer mySize; //!< Total amount of items
@ -316,8 +307,4 @@ template <class TheItemType> class NCollection_Array2
};
#ifdef WNT
#pragma warning (default:4291)
#endif
#endif

View File

@ -7,6 +7,7 @@
#define NCollection_BaseCollection_HeaderFile
#include <NCollection_IncAllocator.hxx>
#include <NCollection_DefineAlloc.hxx>
/**
* Purpose: NCollection_BaseCollection is the base abstract class for
@ -45,6 +46,9 @@ template<class TheItemType> class NCollection_BaseCollection
virtual const TheItemType& Value(void) const=0;
//! Value change access
virtual TheItemType& ChangeValue(void) const=0;
public:
DEFINE_STANDARD_ALLOC
DEFINE_NCOLLECTION_ALLOC
protected:
//! Empty constructor
Iterator (void) {}

View File

@ -20,11 +20,6 @@
#include <Standard_NoSuchObject.hxx>
#include <NCollection_ListNode.hxx>
#ifdef WNT
// Disable the warning "operator new unmatched by delete"
#pragma warning (disable:4291)
#endif
typedef void (* NCollection_DelListNode)
(NCollection_ListNode*, Handle(NCollection_BaseAllocator)& theAl);

View File

@ -16,11 +16,6 @@
#include <NCollection_BaseAllocator.hxx>
#include <NCollection_ListNode.hxx>
//#ifdef WNT
//// Disable the warning "operator new unmatched by delete"
//#pragma warning (disable:4291)
//#endif
typedef void (* NCollection_DelMapNode)
(NCollection_ListNode*, Handle(NCollection_BaseAllocator)& theAl);

View File

@ -11,12 +11,7 @@
#include <NCollection_Map.hxx>
#include <NCollection_DataMap.hxx>
#include <NCollection_BaseAllocator.hxx>
// work-around for obsolete SUN WorkShop 5.3 compiler
// which does not recognize typename keyword
#if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x530) && ! defined(typename)
#define typename
#endif
#include <NCollection_TypeDef.hxx>
//! Auxiliary enumeration serving as responce from method Inspect
enum NCollection_CellFilter_Action
@ -109,8 +104,8 @@ template <class Inspector>
class NCollection_CellFilter
{
public:
typedef typename Inspector::Target Target;
typedef typename Inspector::Point Point;
typedef TYPENAME Inspector::Target Target;
typedef TYPENAME Inspector::Point Point;
public:

View File

@ -15,12 +15,6 @@
#include <Standard_TypeMismatch.hxx>
#include <Standard_NoSuchObject.hxx>
#ifdef WNT
// Disable the warning "operator new unmatched by delete"
#pragma warning (push)
#pragma warning (disable:4291)
#endif
/**
* Purpose: The DataMap is a Map to store keys with associated
* Items. See Map from NCollection for a discussion
@ -119,10 +113,6 @@ template < class TheKeyType,
#endif
return ((DataMapNode *) myNode)->Key();
}
//! Operator new for allocating iterators
void* operator new(size_t theSize,
const Handle(NCollection_BaseAllocator)& theAllocator)
{ return theAllocator->Allocate(theSize); }
};
public:
@ -342,9 +332,5 @@ template < class TheKeyType,
};
#ifdef WNT
#pragma warning (pop)
#endif
#endif

View File

@ -0,0 +1,33 @@
// File: Standard_DefineAlloc.hxx
// Created: Jan 19 14:15:16 2012
// Author: Dmitry BOBYLEV
// Copyright: Open CASCADE SAS 2012
#ifndef _NCollection_DefineAlloc_HeaderFile
# define _NCollection_DefineAlloc_HeaderFile
// Macro to overload placement new and delete operators for NCollection allocators.
// For Borland C and old SUN compilers do not define placement delete
// as it is not supported.
# if defined(__BORLANDC__) || (defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x530))
# define DEFINE_NCOLLECTION_ALLOC \
void* operator new (size_t theSize, \
const Handle(NCollection_BaseAllocator)& theAllocator) \
{ \
return theAllocator->Allocate(theSize); \
}
# else
# define DEFINE_NCOLLECTION_ALLOC \
void* operator new (size_t theSize, \
const Handle(NCollection_BaseAllocator)& theAllocator) \
{ \
return theAllocator->Allocate(theSize); \
} \
void operator delete (void* theAddress, \
const Handle(NCollection_BaseAllocator)& theAllocator) \
{ \
theAllocator->Free(theAddress); \
}
# endif
#endif

View File

@ -39,11 +39,6 @@
#include <NCollection_DefineBaseCollection.hxx>
#include <NCollection_Array1.hxx>
#ifdef WNT
// Disable the warning "operator new unmatched by delete"
#pragma warning (disable:4291)
#endif
// *********************************************** Template for Array1 class
#define DEFINE_ARRAY1(_ClassName_, _BaseCollection_, TheItemType) \

View File

@ -23,11 +23,6 @@
#include <NCollection_DefineBaseCollection.hxx>
#include <NCollection_Array2.hxx>
#ifdef WNT
// Disable the warning "operator new unmatched by delete"
#pragma warning (disable:4291)
#endif
// *********************************************** Template for Array2 class
#define DEFINE_ARRAY2(_ClassName_, _BaseCollection_, TheItemType) \

View File

@ -26,11 +26,6 @@
#include <NCollection_DefineBaseCollection.hxx>
#include <NCollection_DataMap.hxx>
#ifdef WNT
// Disable the warning "operator new unmatched by delete"
#pragma warning (disable:4291)
#endif
// *********************************************** Class DataMap *************
#define DEFINE_DATAMAP(_ClassName_, _BaseCollection_, TheKeyType, TheItemType) \

View File

@ -16,11 +16,6 @@
#include <NCollection_DefineBaseCollection.hxx>
#include <NCollection_DoubleMap.hxx>
#ifdef WNT
// Disable the warning "operator new unmatched by delete"
#pragma warning (disable:4291)
#endif
// *********************************************** Class DoubleMap ************
#define DEFINE_DOUBLEMAP(_ClassName_, _BaseCollection_, TheKey1Type, TheKey2Type) \

View File

@ -27,11 +27,6 @@
#include <NCollection_DefineBaseCollection.hxx>
#include <NCollection_IndexedDataMap.hxx>
#ifdef WNT
// Disable the warning "operator new unmatched by delete"
#pragma warning (disable:4291)
#endif
// *********************************************** Class IndexedDataMap ******
#define DEFINE_INDEXEDDATAMAP(_ClassName_, _BaseCollection_, TheKeyType, TheItemType) \

View File

@ -19,11 +19,6 @@
#include <NCollection_DefineBaseCollection.hxx>
#include <NCollection_IndexedMap.hxx>
#ifdef WNT
// Disable the warning "operator new unmatched by delete"
#pragma warning (disable:4291)
#endif
// *********************************************** Class IndexedMap ***********
#define DEFINE_INDEXEDMAP(_ClassName_, _BaseCollection_, TheKeyType) \

View File

@ -16,11 +16,6 @@
#include <NCollection_List.hxx>
#ifdef WNT
// Disable the warning "operator new unmatched by delete"
#pragma warning (disable:4291)
#endif
// **************************************** Template for List class ********
#define DEFINE_LIST(_ClassName_, _BaseCollection_, TheItemType) \

View File

@ -36,11 +36,6 @@
#include <NCollection_DefineBaseCollection.hxx>
#include <NCollection_Map.hxx>
#ifdef WNT
// Disable the warning "operator new unmatched by delete"
#pragma warning (disable:4291)
#endif
// *********************************************** Class Map *****************
#define DEFINE_MAP(_ClassName_, _BaseCollection_, TheKeyType) \

View File

@ -18,11 +18,6 @@
#include <NCollection_Queue.hxx>
#ifdef WNT
// Disable the warning "operator new unmatched by delete"
#pragma warning (disable:4291)
#endif
// **************************************** Template for Queue class ********
#define DEFINE_QUEUE(_ClassName_, _BaseCollection_, TheItemType) \

View File

@ -43,11 +43,6 @@
#include <NCollection_DefineBaseCollection.hxx>
#include <NCollection_SList.hxx>
#ifdef WNT
// Disable the warning "operator new unmatched by delete"
#pragma warning (disable:4291)
#endif
// **************************************** Template for SList class ********
#define DEFINE_SLIST(_ClassName_, _BaseCollection_, TheItemType) \

View File

@ -15,11 +15,6 @@
#include <NCollection_DefineBaseCollection.hxx>
#include <NCollection_Sequence.hxx>
#ifdef WNT
// Disable the warning "operator new unmatched by delete"
#pragma warning (disable:4291)
#endif
// **************************************** Template for Sequence class ********
#define DEFINE_SEQUENCE(_ClassName_, _BaseCollection_, TheItemType) \

View File

@ -18,11 +18,6 @@
#include <NCollection_DefineBaseCollection.hxx>
#include <NCollection_Set.hxx>
#ifdef WNT
// Disable the warning "operator new unmatched by delete"
#pragma warning (disable:4291)
#endif
// **************************************** Template for Set class ********
#define DEFINE_SET(_ClassName_, _BaseCollection_, TheItemType) \

View File

@ -19,11 +19,6 @@
#include <NCollection_DefineBaseCollection.hxx>
#include <NCollection_Stack.hxx>
#ifdef WNT
// Disable the warning "operator new unmatched by delete"
#pragma warning (disable:4291)
#endif
// **************************************** Template for Stack class ********
#define DEFINE_STACK(_ClassName_, _BaseCollection_, TheItemType) \

View File

@ -14,11 +14,6 @@
#include <NCollection_DefineBaseCollection.hxx>
#include <NCollection_TListIterator.hxx>
#ifdef WNT
// Disable the warning "operator new unmatched by delete"
#pragma warning (disable:4291)
#endif
// ********************************** Implementation of the Iterator interface
#define DEFINE_TLISTITERATOR(_ClassName_, _BaseCollection_, TheItemType) \
typedef NCollection_TListIterator<TheItemType > _ClassName_;

View File

@ -12,11 +12,6 @@
#include <NCollection_TListNode.hxx>
#ifdef WNT
// Disable the warning "operator new unmatched by delete"
#pragma warning (disable:4291)
#endif
// ******************************* Class defining list node - for internal use
#define DEFINE_TLISTNODE(_ClassName_, _BaseCollection_, TheItemType) \
typedef NCollection_TListNode<TheItemType > _ClassName_;

View File

@ -11,11 +11,6 @@
#include <NCollection_DefineBaseCollection.hxx>
#include <NCollection_Vector.hxx>
#ifdef WNT
// Disable the warning: "operator new unmatched by delete"
#pragma warning (disable:4291)
#endif
// Class NCollection_Vector (dynamic array of objects)
//
// This class is similar to NCollection_Array1 though the indices always start

View File

@ -17,12 +17,6 @@
#include <NCollection_DefaultHasher.hxx>
#ifdef WNT
// Disable the warning "operator new unmatched by delete"
#pragma warning (push)
#pragma warning (disable:4291)
#endif
/**
* Purpose: The DoubleMap is used to bind pairs (Key1,Key2)
* and retrieve them in linear time.
@ -128,10 +122,6 @@ template < class TheKey1Type,
Standard_ImmutableObject::Raise("NCollection_DoubleMap::Iterator::ChangeValue");
return * (TheKey2Type *) NULL; // For compiler
}
//! Operator new for allocating iterators
void* operator new(size_t theSize,
const Handle(NCollection_BaseAllocator)& theAllocator)
{ return theAllocator->Allocate(theSize); }
};
public:
@ -476,8 +466,4 @@ template < class TheKey1Type,
};
#ifdef WNT
#pragma warning (pop)
#endif
#endif

View File

@ -18,12 +18,6 @@
#include <Standard_OutOfRange.hxx>
#endif
#ifdef WNT
// Disable the warning "operator new unmatched by delete"
#pragma warning (push)
#pragma warning (disable:4291)
#endif
/**
* Purpose: An indexed map is used to store keys and to bind
* an index to them. Each new key stored in the map
@ -127,10 +121,6 @@ template < class TheKeyType,
#endif
return myMap->ChangeFromIndex(myIndex);
}
//! Operator new for allocating iterators
void* operator new(size_t theSize,
const Handle(NCollection_BaseAllocator)& theAllocator)
{ return theAllocator->Allocate(theSize); }
private:
NCollection_IndexedDataMap * myMap; //!< Pointer to the map being iterated
@ -505,8 +495,4 @@ template < class TheKeyType,
};
#ifdef WNT
#pragma warning (pop)
#endif
#endif

View File

@ -18,12 +18,6 @@
#include <Standard_OutOfRange.hxx>
#endif
#ifdef WNT
// Disable the warning "operator new unmatched by delete"
#pragma warning (push)
#pragma warning (disable:4291)
#endif
/**
* Purpose: An indexed map is used to store keys and to bind
* an index to them. Each new key stored in the map
@ -115,11 +109,6 @@ template < class TheKeyType,
return * (TheKeyType *) NULL; // This for compiler
}
//! Operator new for allocating iterators
void* operator new(size_t theSize,
const Handle(NCollection_BaseAllocator)& theAllocator)
{ return theAllocator->Allocate(theSize); }
private:
NCollection_IndexedMap * myMap; // Pointer to the map being iterated
Standard_Integer myIndex; // Current index
@ -417,8 +406,4 @@ template < class TheKeyType,
};
#ifdef WNT
#pragma warning (pop)
#endif
#endif

View File

@ -13,12 +13,6 @@
#include <Standard_NoSuchObject.hxx>
#endif
#ifdef WNT
// Disable the warning "operator new unmatched by delete"
#pragma warning (push)
#pragma warning (disable:4291)
#endif
/**
* Purpose: Simple list to link items together keeping the first
* and the last one.
@ -291,8 +285,4 @@ template <class TheItemType> class NCollection_List
}
};
#ifdef WNT
#pragma warning (pop)
#endif
#endif

View File

@ -8,11 +8,6 @@
#include <NCollection_BaseAllocator.hxx>
#ifdef WNT
// Disable the warning "operator new unmatched by delete"
#pragma warning (disable:4291)
#endif
/**
* Purpose: This class is used to represent a node in the BaseList and
* BaseMap.

View File

@ -18,12 +18,6 @@
#include <Standard_NoSuchObject.hxx>
#endif
#ifdef WNT
// Disable the warning "operator new unmatched by delete"
#pragma warning (push)
#pragma warning (disable:4291)
#endif
/**
* Purpose: Single hashed Map. This Map is used to store and
* retrieve keys in linear time.
@ -116,10 +110,6 @@ template < class TheKeyType,
#endif
return ((MapNode *) myNode)->Value();
}
//! Operator new for allocating iterators
void* operator new(size_t theSize,
const Handle(NCollection_BaseAllocator)& theAllocator)
{ return theAllocator->Allocate(theSize); }
};
public:
@ -318,8 +308,4 @@ template < class TheKeyType,
};
#ifdef WNT
#pragma warning (pop)
#endif
#endif

View File

@ -13,11 +13,6 @@
#include <Standard_NoSuchObject.hxx>
#endif
#ifdef WNT
// Disable the warning "operator new unmatched by delete"
#pragma warning (disable:4291)
#endif
/**
* Purpose: A queue is a structure where Items are added at
* the end and removed from the front. The first
@ -135,8 +130,4 @@ template <class TheItemType> class NCollection_Queue
};
#ifdef WNT
#pragma warning (default:4291)
#endif
#endif

View File

@ -12,11 +12,6 @@
#include <Standard_NoSuchObject.hxx>
#endif
#ifdef WNT
// Disable the warning "operator new unmatched by delete"
#pragma warning (disable:4291)
#endif
/**
* Purpose: An SList is a LISP like list of Items.
* An SList is :
@ -76,15 +71,10 @@ template <class TheItemType> class NCollection_SList
myTail->Clear();
myTail->myAllocator->Free(myTail);
}
//! Operator new for allocating nodes
void* operator new(size_t theSize,
const Handle(NCollection_BaseAllocator)& theAllocator)
{ return theAllocator->Allocate(theSize); }
//! news to avoid warnings on hiding - not for use
void* operator new(size_t theSize)
{ return Standard::Allocate(theSize); }
void* operator new(size_t /*theSize*/, void* theAddress)
{ return theAddress; }
DEFINE_STANDARD_ALLOC
DEFINE_NCOLLECTION_ALLOC
private:
// ---------- PRIVATE FIELDS ------------
Standard_Integer myCount; //!< Reference count
@ -118,11 +108,6 @@ template <class TheItemType> class NCollection_SList
myNode->myCount++;
}
//! Operator new for creating 'iterator'
void* operator new(size_t theSize,
const Handle(NCollection_BaseAllocator)& theAllocator)
{ return theAllocator->Allocate(theSize); }
//! Clear the items out
void Clear (void)
{
@ -287,8 +272,4 @@ template <class TheItemType> class NCollection_SList
friend class SListNode;
};
#ifdef WNT
#pragma warning (default:4291)
#endif
#endif

View File

@ -14,12 +14,6 @@
#include <Standard_NoSuchObject.hxx>
#endif
#ifdef WNT
// Disable the warning "operator new unmatched by delete"
#pragma warning (push)
#pragma warning (disable:4291)
#endif
/**
* Purpose: Definition of a sequence of elements indexed by
* an Integer in range of 1..n
@ -43,9 +37,8 @@ template <class TheItemType> class NCollection_Sequence
//! Variable value access
TheItemType& ChangeValue () { return myValue; }
//! Memory allocation
void* operator new(size_t theSize,
const Handle(NCollection_BaseAllocator)& theAllocator)
{ return theAllocator->Allocate(theSize); }
DEFINE_STANDARD_ALLOC
DEFINE_NCOLLECTION_ALLOC
private:
TheItemType myValue;
@ -82,10 +75,6 @@ template <class TheItemType> class NCollection_Sequence
//! Variable value access
virtual TheItemType& ChangeValue (void) const
{ return ((Node *)myCurrent)->ChangeValue(); }
//! Operator new for allocating iterators
void* operator new(size_t theSize,
const Handle(NCollection_BaseAllocator)& theAllocator)
{ return theAllocator->Allocate(theSize); }
}; // End of nested class Iterator
public:
@ -315,8 +304,4 @@ template <class TheItemType> class NCollection_Sequence
};
#ifdef WNT
#pragma warning (pop)
#endif
#endif

View File

@ -12,11 +12,6 @@
#include <NCollection_TListNode.hxx>
#include <NCollection_TListIterator.hxx>
#ifdef WNT
// Disable the warning "operator new unmatched by delete"
#pragma warning (disable:4291)
#endif
/**
* Purpose: A set is an unordered collection of items without
* duplications. To test for duplications the operators == and !=
@ -220,8 +215,4 @@ template <class TheItemType> class NCollection_Set
};
#ifdef WNT
#pragma warning (default:4291)
#endif
#endif

View File

@ -8,12 +8,6 @@
#include <NCollection_SparseArrayBase.hxx>
#ifdef WNT
// Disable the warning "operator new unmatched by delete"
#pragma warning (push)
#pragma warning (disable:4291)
#endif
/**
* Dynamically resizable sparse array of objects
*
@ -266,9 +260,5 @@ private:
};
#ifdef WNT
#pragma warning (pop)
#endif
#endif

View File

@ -15,11 +15,6 @@
#include <Standard_NoSuchObject.hxx>
#endif
#ifdef WNT
// Disable the warning "operator new unmatched by delete"
#pragma warning (disable:4291)
#endif
/**
* Purpose: A stack is a structure where item can be added and
* removed from the top. Like a stack of plates in a
@ -135,8 +130,4 @@ template <class TheItemType> class NCollection_Stack
};
#ifdef WNT
#pragma warning (default:4291)
#endif
#endif

View File

@ -10,12 +10,6 @@
#include <NCollection_BaseList.hxx>
#include <NCollection_TListNode.hxx>
#ifdef WNT
// Disable the warning "operator new unmatched by delete"
#pragma warning (push)
#pragma warning (disable:4291)
#endif
/**
* Purpose: This Iterator class iterates on BaseList of TListNode and is
* instantiated in List/Set/Queue/Stack
@ -54,14 +48,6 @@ template <class TheItemType> class NCollection_TListIterator
//! Variable Value access
virtual TheItemType& ChangeValue (void) const
{ return ((NCollection_TListNode<TheItemType> *)myCurrent)->ChangeValue(); }
//! Operator new for allocating iterators
void* operator new(size_t theSize,
const Handle(NCollection_BaseAllocator)& theAllocator)
{ return theAllocator->Allocate(theSize); }
};
#ifdef WNT
#pragma warning (pop)
#endif
#endif

View File

@ -8,12 +8,7 @@
#include <NCollection_ListNode.hxx>
#include <NCollection_BaseAllocator.hxx>
#ifdef WNT
// Disable the warning "operator new unmatched by delete"
#pragma warning (push)
#pragma warning (disable:4291)
#endif
#include <NCollection_DefineAlloc.hxx>
/**
* Purpose: Abstract list node class. Used by BaseList
@ -32,9 +27,8 @@ template <class TheItemType> class NCollection_TListNode
//! Variable value access
TheItemType& ChangeValue () { return myValue; }
//! Memory allocation
void* operator new(size_t theSize,
const Handle(NCollection_BaseAllocator)& theAllocator)
{ return theAllocator->Allocate(theSize); }
DEFINE_STANDARD_ALLOC
DEFINE_NCOLLECTION_ALLOC
//! Static deleter to be passed to BaseList
static void delNode (NCollection_ListNode * theNode,
Handle(NCollection_BaseAllocator)& theAl)
@ -49,8 +43,4 @@ template <class TheItemType> class NCollection_TListNode
};
#ifdef WNT
#pragma warning (pop)
#endif
#endif

View File

@ -7,12 +7,7 @@
#define NCollection_UBTree_HeaderFile
#include <NCollection_BaseAllocator.hxx>
#ifdef WNT
// Disable the warning: "operator new unmatched by delete"
#pragma warning (push)
#pragma warning (disable:4291)
#endif
#include <NCollection_DefineAlloc.hxx>
/**
* The algorithm of unbalanced binary tree of overlapped bounding boxes.
@ -116,6 +111,10 @@ template <class TheObjType, class TheBndType> class NCollection_UBTree
*/
class TreeNode
{
public:
DEFINE_STANDARD_ALLOC
DEFINE_NCOLLECTION_ALLOC
public:
TreeNode (const TheObjType& theObj, const TheBndType& theBnd)
: myBnd(theBnd), myObject(theObj), myChildren(0), myParent(0) {}
@ -195,20 +194,6 @@ template <class TheObjType, class TheBndType> class NCollection_UBTree
// ~TreeNode () { if (myChildren) delete [] myChildren; }
~TreeNode () { myChildren = 0L; }
/**
* Allocator of a tree node.
*/
void * operator new (size_t theSize,
const Handle(NCollection_BaseAllocator)& theAllocator)
{ return theAllocator->Allocate(theSize); }
/**
* Allocator of a tree node.
*/
void * operator new (size_t,
void * theMem)
{ return theMem; }
/**
* Deleter of tree node. The whole hierarchy of its children also deleted.
* This method should be used instead of operator delete.
@ -500,8 +485,4 @@ DEFINE_STANDARD_HANDLE (_HUBTREE, _HPARENT)
IMPLEMENT_STANDARD_HANDLE (_HUBTREE, _HPARENT) \
IMPLEMENT_STANDARD_RTTIEXT(_HUBTREE, _HPARENT)
#ifdef WNT
#pragma warning (pop)
#endif
#endif

View File

@ -14,12 +14,6 @@
#include <Standard_OutOfRange.hxx>
#endif
#ifdef WNT
// Disable the warning: "operator new unmatched by delete"
#pragma warning (push)
#pragma warning (disable:4291)
#endif
/**
* Class NCollection_Vector (dynamic array of objects)
*
@ -54,8 +48,9 @@ template <class TheItemType> class NCollection_Vector
//! Nested class MemBlock
class MemBlock : public NCollection_BaseVector::MemBlock
{
public:
void * operator new (size_t, void * theAddress) { return theAddress; }
public:
DEFINE_STANDARD_ALLOC
//! Empty constructor
MemBlock (NCollection_BaseAllocator* theAlloc)
: NCollection_BaseVector::MemBlock(0,0,theAlloc)
@ -156,10 +151,6 @@ template <class TheItemType> class NCollection_Vector
//! Variable value access
virtual TheItemType& ChangeValue (void) const {
return ((MemBlock *) CurBlockV()) -> ChangeValue(myCurIndex); }
//! Operator new for allocating iterators
void* operator new(size_t theSize,
const Handle(NCollection_BaseAllocator)& theAllocator)
{ return theAllocator->Allocate(theSize); }
}; // End of the nested class Iterator
// ----------------------------------------------------------------------
@ -306,8 +297,4 @@ template <class TheItemType> class NCollection_Vector
friend class Iterator;
};
#ifdef WNT
#pragma warning (pop)
#endif
#endif

View File

@ -15,8 +15,8 @@
#include <Bnd_B3f.hxx>
#ifdef WNT
// Disable the warning "operator new unmatched by delete"
#pragma warning (push)
// Disable warning 4480: nonstandard extension used: specifying underlying type for enum 'enum'
#pragma warning (disable:4480)
#endif

View File

@ -10,12 +10,6 @@
#include <NIS_InteractiveObject.hxx>
#include <Quantity_Color.hxx>
#ifdef WNT
// Disable the warning "operator new unmatched by delete"
#pragma warning (push)
#pragma warning (disable:4291)
#endif
class Handle_NIS_TriangulatedDrawer;
class NCollection_BaseAllocator;
class Handle_NCollection_BaseAllocator;
@ -465,24 +459,13 @@ class NIS_Triangulated : public NIS_InteractiveObject
*/
Standard_EXPORT virtual void Delete () const;
/**
* Operator new for memory allocation uses Open CASCADE memory manager
*/
void* operator new (size_t size)
{
return Standard::Allocate(size);
}
protected:
/**
* Allocator-based operator new for dynamic allocations in method Clone()
*/
void* operator new (Standard_Size theSz,
const Handle(NCollection_BaseAllocator)& theAllocator)
{
return theAllocator->Allocate(theSz);
}
DEFINE_STANDARD_ALLOC
DEFINE_NCOLLECTION_ALLOC
/**
* Create a 3D bounding box of the object.
@ -536,8 +519,4 @@ DEFINE_STANDARD_RTTI (NIS_Triangulated)
// Definition of HANDLE object using Standard_DefineHandle.hxx
DEFINE_STANDARD_HANDLE (NIS_Triangulated, NIS_InteractiveObject)
#ifdef WNT
#pragma warning (pop)
#endif
#endif

View File

@ -24,7 +24,7 @@ struct OPENGL_SURF_PROP
int isphysic;
unsigned int color_mask;
TEL_COLOUR speccol, difcol, ambcol, emscol, matcol;
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
struct TEL_CONTEXT_FACE
@ -39,7 +39,7 @@ struct TEL_CONTEXT_FACE
int doTextureMap;
int TexId;
TEL_POFFSET_PARAM PolygonOffset;
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
#include <OpenGl_Element.hxx>
@ -67,7 +67,7 @@ class OpenGl_AspectFace : public OpenGl_Element
OpenGl_AspectLine myAspectEdge;
public:
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
#endif //_OpenGl_AspectFace_Header

View File

@ -34,7 +34,7 @@ class OpenGl_AspectLine : public OpenGl_Element
float myWidth;
public:
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
#endif //_OpenGl_AspectLine_Header

View File

@ -33,7 +33,7 @@ class OpenGl_AspectMarker : public OpenGl_Element
float myScale;
public:
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
#endif //OpenGl_AspectMarker_Header

View File

@ -49,7 +49,7 @@ class OpenGl_AspectText : public OpenGl_Element
TEL_COLOUR mySubtitleColor;
public:
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
#endif //OpenGl_AspectText_Header

View File

@ -15,7 +15,7 @@ struct OpenGl_CView
{
Handle_OpenGl_Workspace WS;
Handle_OpenGl_View View;
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
#endif //OpenGl_CView_Header

View File

@ -40,7 +40,7 @@ struct OPENGL_MARKER_DATA
unsigned int Width;
unsigned int Height;
unsigned char* Array;
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
typedef NCollection_DataMap<int,OPENGL_MARKER_DATA> OpenGl_MapOfUserMarker;
@ -150,7 +150,7 @@ class OpenGl_Display : public MMgt_TShared
Standard_Integer myFontSize;
public:
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
extern Handle(OpenGl_Display) openglDisplay;

View File

@ -17,7 +17,7 @@ class OpenGl_Element
virtual void Render (const Handle(OpenGl_Workspace) &AWorkspace) const = 0;
public:
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
#endif //OpenGl_Element_Header

View File

@ -58,7 +58,7 @@ class OpenGl_GraduatedTrihedron : public MMgt_TShared
void* myPtrVisual3dView;
public:
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
#endif //_OpenGl_GraduatedTrihedron_Header

View File

@ -22,7 +22,7 @@ struct OpenGl_ElementNode
TelType type;
OpenGl_Element *elem;
OpenGl_ElementNode *next;
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
class OpenGl_Group : public OpenGl_Element
@ -53,7 +53,7 @@ class OpenGl_Group : public OpenGl_Element
OpenGl_ElementNode *myFirst, *myLast;
public:
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
#endif //_OpenGl_Group_Header

View File

@ -22,7 +22,7 @@ struct OpenGl_Light
Tfloat shine;
Tfloat atten[2];
Tfloat angle;
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
typedef NCollection_List<OpenGl_Light> OpenGl_ListOfLight;

View File

@ -24,7 +24,7 @@ class OpenGl_Marker : public OpenGl_Element
TEL_POINT myPoint;
public:
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
#endif //OpenGl_Marker_Header

View File

@ -27,7 +27,7 @@ class OpenGl_MarkerSet : public OpenGl_Element
TEL_POINT *myPoints;
public:
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
#endif //OpenGl_MarkerSet_Header

View File

@ -11,7 +11,7 @@
struct OpenGl_Matrix
{
float mat[4][4];
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
Standard_EXPORT void OpenGl_Multiplymat3 (OpenGl_Matrix *c, const OpenGl_Matrix *a, const OpenGl_Matrix *b);

View File

@ -33,7 +33,7 @@ struct TEL_INDEXPOLY_DATA
tel_colour vcolours; /* Vertex colour values */
tel_point vnormals; /* Vertex normals */
tel_texture_coord vtexturecoord; /* Texture Coordinates */
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
class OpenGl_Mesh : public OpenGl_Element
@ -72,7 +72,7 @@ class OpenGl_Mesh : public OpenGl_Element
DS_INTERNAL *myDS;
public:
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
#endif //OpenGl_Mesh_Header

View File

@ -27,7 +27,7 @@ struct EXTRA_VERTEX
{
GLfloat vert[3];
int ind;
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
typedef EXTRA_VERTEX* extra_vertex;
@ -36,7 +36,7 @@ struct SEQ_
Tint ts_num, ts_alloc;
void **tmesh_sequence;
GLenum triangle_type; /* FSXXX OPTI */
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
struct OPENGL_DISPLAY_PGN
@ -44,7 +44,7 @@ struct OPENGL_DISPLAY_PGN
Tint num_of_seq;
Tint num_alloc;
SEQ_ *seq;
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
static void bgntriangulate( const TEL_POLYGON_DATA *, void (APIENTRY*)() );

View File

@ -30,7 +30,7 @@ struct TEL_POLYGON_DATA
tel_point vnormals; /* Vertex normals */
tel_texture_coord vtexturecoord; /* Texture Coordinates */
OPENGL_DISPLAY_PGN *dsply;
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
class OpenGl_Polygon : public OpenGl_Element
@ -56,7 +56,7 @@ class OpenGl_Polygon : public OpenGl_Element
TEL_POLYGON_DATA myData;
public:
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
#endif //OpenGl_Polygon_Header

View File

@ -32,7 +32,7 @@ class OpenGl_Polyline : public OpenGl_Element
tel_colour myColors; // Vertex color values for each vertex
public:
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
#endif //OpenGl_Polyline_Header

View File

@ -79,7 +79,7 @@ protected:
public:
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};

View File

@ -49,7 +49,7 @@ class OpenGl_PriorityList
Standard_Integer myNbStructures;
public:
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
#endif //_OpenGl_PriorityList_Header

View File

@ -27,7 +27,7 @@ struct OPENGL_QSTRIP_DATA
tel_colour vcolours; /* Vertex colour values */
tel_point vnormals; /* Vertex normals */
tel_texture_coord vtexturecoord; /* Texture coordinates */
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
class OpenGl_QuadrangleStrip : public OpenGl_Element
@ -60,7 +60,7 @@ class OpenGl_QuadrangleStrip : public OpenGl_Element
DS_INTERNAL *myDS;
public:
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
#endif //OpenGl_QuadrangleStrip_Header

View File

@ -83,7 +83,7 @@ class OpenGl_Structure : public OpenGl_Element
OpenGl_ListOfGroup myGroups;
public:
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
#endif //OpenGl_Structure_Header

View File

@ -35,7 +35,7 @@ class OpenGl_Text : public OpenGl_Element
const wchar_t *myString;
public:
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
#endif //OpenGl_Text_Header

View File

@ -15,7 +15,7 @@ struct OpenGl_TextParam
int Height;
Graphic3d_HorizontalTextAlignment HAlign;
Graphic3d_VerticalTextAlignment VAlign;
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
#endif //_OpenGl_TextParam_Header

View File

@ -85,7 +85,7 @@ struct texData
texDataStatus status;
GLint type;
int share_count;
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
@ -110,7 +110,7 @@ struct texDraw
GLfloat transx, transy;
GLfloat angle;
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};

View File

@ -48,6 +48,7 @@
*/
#include <OpenGl_tgl_all.hxx>
#include <Standard_DefineAlloc.hxx>
#include <GL/gl.h>
@ -76,7 +77,7 @@ struct _TextureData
GLfloat scalex, scaley;
GLfloat transx, transy;
GLfloat angle;
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
typedef _TextureData TextureData;

View File

@ -25,7 +25,7 @@ struct TEL_TMESH_DATA
tel_colour vcolours; /* length = num_facets + 2 */
tel_point vnormals; /* length = num_facets + 2 */
tel_texture_coord vtexturecoord; /* Texture coordinates */
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
class OpenGl_TriangleStrip : public OpenGl_Element
@ -58,7 +58,7 @@ class OpenGl_TriangleStrip : public OpenGl_Element
DS_INTERNAL *myDS;
public:
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
#endif //OpenGl_TriangleStrip_Header

View File

@ -49,7 +49,7 @@ class OpenGl_Trihedron : public MMgt_TShared
OpenGl_AspectText myAspectText;
public:
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
#endif //_OpenGl_Trihedron_Header

View File

@ -61,7 +61,7 @@ struct OPENGL_EXTRA_REP
struct OPENGL_CLIP_REP
{
Standard_Real equation[4];
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
struct OPENGL_ZCLIP
@ -226,7 +226,7 @@ class OpenGl_View : public MMgt_TShared
Standard_Boolean myResetFLIST;
public:
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
#endif //_OpenGl_View_Header

View File

@ -59,7 +59,7 @@ struct OPENGL_CLIP_PLANE
{
GLboolean isEnabled;
GLdouble Equation[4];
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};
/*----------------------------------------------------------------------*/

View File

@ -99,7 +99,7 @@ protected:
public:
DEFINE_STANDARD_RTTI(OpenGl_Window) // Type definition
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};

View File

@ -217,7 +217,7 @@ protected:
public:
DEFINE_STANDARD_RTTI(OpenGl_Workspace) // Type definition
IMPLEMENT_MEMORY_OPERATORS
DEFINE_STANDARD_ALLOC
};

View File

@ -8,7 +8,7 @@
#include <Poly_CoherentTriangle.hxx>
#ifdef WNT
#pragma warning(disable:4291 4996)
#pragma warning(disable:4996)
#endif
//=======================================================================

View File

@ -6,10 +6,6 @@
#include <Poly_CoherentTriPtr.hxx>
#ifdef WNT
#pragma warning(disable:4291)
#endif
//=======================================================================
//function : Iterator::Next
//purpose :

View File

@ -8,12 +8,13 @@
#define Poly_CoherentTriPtr_HeaderFile
#include <NCollection_BaseAllocator.hxx>
#include <NCollection_DefineAlloc.hxx>
class Poly_CoherentTriangle;
#ifdef WNT
#pragma warning (push)
#pragma warning(disable:4355 4291) //'this' : used in base member initializer list
#pragma warning(disable:4355) //'this' : used in base member initializer list
#endif
/**
@ -78,11 +79,7 @@ class Poly_CoherentTriPtr
/**
* Operator new for dynamic allocations
*/
void* operator new (Standard_Size theSize,
const Handle(NCollection_BaseAllocator)& theAllocator)
{
return theAllocator->Allocate(theSize);
}
DEFINE_NCOLLECTION_ALLOC
/**
* Query the stored pointer to Triangle.

View File

@ -22,13 +22,7 @@ struct polyedge {
Standard_Integer nd; // the second node of the edge
Standard_Integer nt[2]; // the two adjacent triangles
Standard_Integer nn[2]; // the two adjacent nodes
void* operator new(size_t aSize)
{return (void*)(Standard::Allocate(aSize));}
// void operator delete(void* aNode, size_t aSize) {
void operator delete(void* aNode) {
Standard_Address anAdress = (Standard_Address)aNode;
Standard::Free(anAdress);
}
DEFINE_STANDARD_ALLOC
};
Poly_Connect::Poly_Connect(const Handle(Poly_Triangulation)& T) :

View File

@ -62,7 +62,6 @@ Standard_values.h
Standard_DefineHandle.hxx
Standard_UUID.cxx
Standard_UUID.hxx
StandardCSFDB.cxx
Standard_Version.hxx
Standard_Mutex.hxx
Standard_Mutex.cxx
@ -73,3 +72,4 @@ Standard_DefineException.hxx
Standard_MMgrTBBalloc.cxx
Standard_MMgrTBBalloc.hxx
Standard_Assert.hxx
Standard_DefineAlloc.hxx

View File

@ -8,6 +8,9 @@
#ifndef _Handle_Standard_Persistent_HeaderFile
#define _Handle_Standard_Persistent_HeaderFile
#ifndef _Standard_DefineAlloc_HeaderFile
#include <Standard_DefineAlloc.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
@ -38,8 +41,6 @@ class Handle_Standard_Persistent;
Standard_EXPORT Standard_Integer HashCode(const Handle(Standard_Persistent)& ,
const Standard_Integer);
Standard_EXPORT Standard_Address StandardCSFDB_Allocate(const Standard_Size);
Standard_EXPORT void StandardCSFDB_Free(Standard_Address&);
class Handle(Standard_Persistent)
{
@ -69,18 +70,7 @@ class Handle(Standard_Persistent)
public:
void* operator new(size_t,void* anAddress)
{
return anAddress;
}
void* operator new(size_t size)
{
return StandardCSFDB_Allocate(size);
}
void operator delete(void *anAddress)
{
if (anAddress) StandardCSFDB_Free(anAddress);
}
DEFINE_STANDARD_ALLOC
Handle(Standard_Persistent)()
{

Some files were not shown because too many files have changed in this diff Show More