Changeset 857633 in git


Ignore:
Timestamp:
Jan 17, 2022, 12:27:24 PM (3 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'd25190065115c859833252500a64cfb7b11e3a50')
Children:
2d5c1931cd9af26341282db39ce50f9e5ae279ff
Parents:
d37ac663bc0d1888fc296b3446deb4daed0939a0
Message:
opt: xalloc stuff
Location:
Singular
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Singular/scanner.cc

    rd37ac6 r857633  
    586586EXTERN_VAR int inerror;
    587587
    588 #ifndef SING_NDEBUG
    589 // this is to  shadow the malloc/realloc
    590 // used by yy_flex_malloc/yy_flex_realloc
    591 // so that we can mark stuff as static
    592 static void* my_malloc(size_t size)
    593 {
    594   void* addr = omAlloc(size);
    595   omMarkAsStaticAddr(addr);
    596   return addr;
    597 }
    598 
    599 static void* my_realloc(void* addr, size_t size)
    600 {
    601   void* new_addr = omRealloc(addr, size);
    602   omMarkAsStaticAddr(new_addr);
    603   return new_addr;
    604 }
    605 #undef malloc
    606 #define malloc my_malloc
    607 #undef realloc
    608 #define realloc my_realloc
    609 #else
     588#ifdef HAVE_OMALLOC
    610589#undef malloc
    611590#define malloc omAlloc
    612591#undef realloc
    613592#define realloc omRealloc
    614 #endif
    615593#undef free
    616594#define free omFree
     595#endif
     596
    617597static char * dupyytext()
    618598{
  • Singular/scanner.ll

    rd37ac6 r857633  
    2626extern int inerror;
    2727
    28 #ifndef SING_NDEBUG
    29 // this is to  shadow the malloc/realloc
    30 // used by yy_flex_malloc/yy_flex_realloc
    31 // so that we can mark stuff as static
    32 static void* my_malloc(size_t size)
    33 {
    34   void* addr = omAlloc(size);
    35   omMarkAsStaticAddr(addr);
    36   return addr;
    37 }
    38 
    39 static void* my_realloc(void* addr, size_t size)
    40 {
    41   void* new_addr = omRealloc(addr, size);
    42   omMarkAsStaticAddr(new_addr);
    43   return new_addr;
    44 }
    45 #undef malloc
    46 #define malloc my_malloc
    47 #undef realloc
    48 #define realloc my_realloc
    49 #else
     28#ifdef HAVE_OMALLOC
    5029#undef malloc
    5130#define malloc omAlloc
    5231#undef realloc
    5332#define realloc omRealloc
    54 #endif
    5533#undef free
    5634#define free omFree
     35#endif
     36
    5737static char * dupyytext()
    5838{
Note: See TracChangeset for help on using the changeset viewer.