Changeset dc50ee in git


Ignore:
Timestamp:
Apr 9, 2015, 1:54:30 PM (8 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
Children:
8024837072c7be2a09fc786de78354ac60cb89c6
Parents:
5406093341f3303d862a426a868f865e391fc180
git-author:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2015-04-09 13:54:30+02:00
git-committer:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2015-04-09 15:05:06+02:00
Message:
moved new/delete to omalloc/onallocClass.*, use for some classes
Files:
7 edited
1 copied
1 moved

Legend:

Unmodified
Added
Removed
  • Singular/Makefile.am

    r540609 rdc50ee  
    158158bin_PROGRAMS = Singular ESingular TSingular $(optional_Singular_programs)
    159159
    160 Singular_SOURCES = tesths.cc mmalloc.cc fegetopt.c fegetopt.h utils.cc  utils.h
     160Singular_SOURCES = tesths.cc fegetopt.c fegetopt.h utils.cc  utils.h
    161161
    162162Singular_LDADD = libSingular.la ${BUILTIN_FLAGS}
     
    164164Singular_LDFLAGS = -static ${AM_LDFLAGS} ${BUILTIN_FLAGS}
    165165
    166 Singulard_SOURCES = tesths.cc mmalloc.cc fegetopt.c fegetopt.h utils.cc  utils.h
     166Singulard_SOURCES = tesths.cc fegetopt.c fegetopt.h utils.cc  utils.h
    167167
    168168Singulard_LDADD = libSingular.la ${BUILTIN_FLAGS}
  • Singular/attrib.h

    r540609 rdc50ee  
    99#include <string.h>
    1010#include <kernel/structs.h>
     11#include <omalloc/omallocClass.h>
    1112
    1213class sattr;
    1314typedef sattr * attr;
    14 class sattr
     15class sattr: public omallocClass
    1516{
    1617  public:
  • factory/canonicalform.h

    r540609 rdc50ee  
    3333#include <factory/templates/ftmpl_factor.h>
    3434#include <factory/templates/ftmpl_matrix.h>
     35#ifdef HAVE_OMALLOC
     36#include <omalloc/omallocClass.h>
     37#endif
    3538
    3639/*BEGINPUBLIC*/
     
    7174**/
    7275class CanonicalForm
     76#ifdef HAVE_OMALLOC
     77       : public omallocClass
     78#endif
    7379{
    7480private:
  • factory/factory.template

    r540609 rdc50ee  
    2525#include <factory/factoryconf.h>
    2626#include <stdint.h>
     27#ifdef HAVE_OMALLOC
     28#include <omalloc/omallocClass.h>
     29#endif
    2730
    2831#ifndef NOSTREAMIO
  • kernel/GBEngine/kutil.h

    r540609 rdc50ee  
    1212
    1313#include <omalloc/omalloc.h>
     14#include <omalloc/omallocClass.h>
    1415#include <misc/mylimits.h>
    1516
     
    271272class skStrategy;
    272273typedef skStrategy * kStrategy;
    273 class skStrategy
     274class skStrategy : public omallocClass
    274275{
    275276public:
  • omalloc/Makefile.am

    r540609 rdc50ee  
    1616
    1717noinst_HEADERS= omPage.h omDefaultConfig.h omReturn.h omGetPageSize.h \
    18   omMalloc.h omMallocSystem.h
     18  omMalloc.h omMallocSystem.h omallocClass.h
    1919
    2020SOURCES=\
     
    2323omAllocSystem.c   omError.c        omStats.c        omRet2Info.c     \
    2424omBin.c           omDebugTrack.c                     \
    25 omalloc_provide.c omAllocFunc.c
     25omalloc_provide.c omAllocFunc.c    omallocClass.cc
    2626
    2727EXTRA_DIST = omalloc.c omtTestAlloc.c omtTest.h omMmap.c
  • omalloc/configure.ac

    r540609 rdc50ee  
    1212AC_CONFIG_SRCDIR(om_Alloc.c)
    1313AC_CONFIG_HEADER([_config.h])
     14
     15AC_PROG_CC
     16AC_PROG_CXX
    1417
    1518SING_RESET_FLAGS()
  • omalloc/omallocClass.cc

    r540609 rdc50ee  
    55* ABSTRACT: standard version of C++-memory management alloc func
    66*/
    7 #include <kernel/mod2.h>
    87
    98#include <omalloc/omalloc.h>
    109
     10#ifdef __cplusplus
     11
    1112#include <new>
    1213#include <stdlib.h>
     14#include <omalloc/omallocClass.h>
    1315
    1416/* We define those, so that our values of
    1517   OM_TRACK and OM_CHECK are used  */
    16 void* operator new ( size_t size )
     18void* omallocClass::operator new ( size_t size )
    1719#ifndef __GNUC__
    1820throw (std::bad_alloc)
     
    2527}
    2628
    27 void operator delete ( void* block )
     29void  omallocClass::operator delete ( void* block )
    2830#ifndef __GNUC__
    2931throw ()
     
    3335}
    3436
    35 void* operator new[] ( size_t size )
     37void*  omallocClass::operator new[] ( size_t size )
    3638#ifndef __GNUC__
    3739throw (std::bad_alloc)
     
    4446}
    4547
    46 void operator delete[] ( void* block )
     48void  omallocClass::operator delete[] ( void* block )
    4749#ifndef __GNUC__
    4850throw ()
     
    7173// long before the exception gets thrown.
    7274
    73 void * operator new(size_t size, const std::nothrow_t &) throw()
     75void *  omallocClass::operator new(size_t size, const std::nothrow_t &) throw()
    7476{
    7577  void* addr;
     
    7981}
    8082
    81 void * operator new[](size_t size, const std::nothrow_t &) throw()
     83void *  omallocClass::operator new[](size_t size, const std::nothrow_t &) throw()
    8284{
    8385  void* addr;
     
    8688  return addr;
    8789}
     90#endif
  • omalloc/omallocClass.h

    r540609 rdc50ee  
     1#ifndef OMALLOCCLASS_H
     2#define OMALLOCCLASS_H
     3
    14/****************************************
    25*  Computer Algebra System SINGULAR     *
     
    58* ABSTRACT: standard version of C++-memory management alloc func
    69*/
    7 #include <kernel/mod2.h>
    810
    9 #include <omalloc/omalloc.h>
     11#ifdef __cplusplus
    1012
    1113#include <new>
    1214#include <stdlib.h>
    1315
     16class omallocClass
     17{
     18public:
    1419/* We define those, so that our values of
    1520   OM_TRACK and OM_CHECK are used  */
     
    1823throw (std::bad_alloc)
    1924#endif
    20 {
    21   void* addr;
    22   if (size==(size_t)0) size = 1;
    23   omTypeAlloc(void*, addr, size);
    24   return addr;
    25 }
    26 
     25;
    2726void operator delete ( void* block )
    2827#ifndef __GNUC__
    2928throw ()
    3029#endif
    31 {
    32   omfree( block );
    33 }
     30;
    3431
    3532void* operator new[] ( size_t size )
     
    3734throw (std::bad_alloc)
    3835#endif
    39 {
    40   void* addr;
    41   if (size==(size_t)0) size = (size_t)1;
    42   omTypeAlloc(void*, addr, size);
    43   return addr;
    44 }
     36;
    4537
    4638void operator delete[] ( void* block )
     
    4840throw ()
    4941#endif
    50 {
    51   omfree( block );
    52 }
     42;
    5343
    5444// The C++ standard has ratified a change to the new operator.
     
    7161// long before the exception gets thrown.
    7262
    73 void * operator new(size_t size, const std::nothrow_t &) throw()
    74 {
    75   void* addr;
    76   if (size==(size_t)0) size = (size_t)1;
    77   omTypeAlloc(void*, addr, size);
    78   return addr;
    79 }
     63void * operator new(size_t size, const std::nothrow_t &) throw();
    8064
    81 void * operator new[](size_t size, const std::nothrow_t &) throw()
    82 {
    83   void* addr;
    84   if (size==(size_t)0) size = (size_t)1;
    85   omTypeAlloc(void*, addr, size);
    86   return addr;
    87 }
     65void * operator new[](size_t size, const std::nothrow_t &) throw();
     66};
     67#endif
     68#endif
Note: See TracChangeset for help on using the changeset viewer.