Changeset a53ae5 in git


Ignore:
Timestamp:
Oct 26, 2010, 1:30:57 PM (14 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b4f17ed1d25f93d46dbe29e4b499baecc2fd51bb')
Children:
9fb928acbc894e6a14185499aa5c1b742dd13cd8
Parents:
7ec061457a32276f5631a769c22351460d82ff0e
Message:
fix redefining for staic proc

git-svn-id: file:///usr/local/Singular/svn/trunk@13570 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
Singular
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • Singular/extra.cc

    r7ec0614 ra53ae5  
    23222322      else
    23232323  #endif
     2324
     2325#if !defined(OM_NDEBUG)
    23242326  /*==================== omMemoryTest ==================================*/
    2325         if (strcmp(sys_cmd,"omMemoryTest")==0)
    2326         {
    2327 
    2328 #if !defined(OM_NDEBUG)
     2327      if (strcmp(sys_cmd,"omMemoryTest")==0)
     2328      {
    23292329
    23302330#ifdef OM_STATS_H
    2331           PrintS("\n[om_Info]: \n");
    2332           omUpdateInfo();
     2331        PrintS("\n[om_Info]: \n");
     2332        omUpdateInfo();
    23332333#define OM_PRINT(name) Print(" %-22s : %10ld \n", #name, om_Info . name)
    2334           OM_PRINT(MaxBytesSystem);
    2335           OM_PRINT(CurrentBytesSystem);
    2336           OM_PRINT(MaxBytesSbrk);
    2337           OM_PRINT(CurrentBytesSbrk);
    2338           OM_PRINT(MaxBytesMmap);
    2339           OM_PRINT(CurrentBytesMmap);
    2340           OM_PRINT(UsedBytes);
    2341           OM_PRINT(AvailBytes);
    2342           OM_PRINT(UsedBytesMalloc);
    2343           OM_PRINT(AvailBytesMalloc);
    2344           OM_PRINT(MaxBytesFromMalloc);
    2345           OM_PRINT(CurrentBytesFromMalloc);
    2346           OM_PRINT(MaxBytesFromValloc);
    2347           OM_PRINT(CurrentBytesFromValloc);
    2348           OM_PRINT(UsedBytesFromValloc);
    2349           OM_PRINT(AvailBytesFromValloc);
    2350           OM_PRINT(MaxPages);
    2351           OM_PRINT(UsedPages);
    2352           OM_PRINT(AvailPages);
    2353           OM_PRINT(MaxRegionsAlloc);
    2354           OM_PRINT(CurrentRegionsAlloc);
     2334        OM_PRINT(MaxBytesSystem);
     2335        OM_PRINT(CurrentBytesSystem);
     2336        OM_PRINT(MaxBytesSbrk);
     2337        OM_PRINT(CurrentBytesSbrk);
     2338        OM_PRINT(MaxBytesMmap);
     2339        OM_PRINT(CurrentBytesMmap);
     2340        OM_PRINT(UsedBytes);
     2341        OM_PRINT(AvailBytes);
     2342        OM_PRINT(UsedBytesMalloc);
     2343        OM_PRINT(AvailBytesMalloc);
     2344        OM_PRINT(MaxBytesFromMalloc);
     2345        OM_PRINT(CurrentBytesFromMalloc);
     2346        OM_PRINT(MaxBytesFromValloc);
     2347        OM_PRINT(CurrentBytesFromValloc);
     2348        OM_PRINT(UsedBytesFromValloc);
     2349        OM_PRINT(AvailBytesFromValloc);
     2350        OM_PRINT(MaxPages);
     2351        OM_PRINT(UsedPages);
     2352        OM_PRINT(AvailPages);
     2353        OM_PRINT(MaxRegionsAlloc);
     2354        OM_PRINT(CurrentRegionsAlloc);
    23552355#undef OM_PRINT
    23562356#endif
    23572357
    23582358#ifdef OM_OPTS_H
    2359           PrintS("\n[om_Opts]: \n");
     2359        PrintS("\n[om_Opts]: \n");
    23602360#define OM_PRINT(format, name) Print(" %-22s : %10" format"\n", #name, om_Opts . name)
    2361           OM_PRINT("d", MinTrack);
    2362           OM_PRINT("d", MinCheck);
    2363           OM_PRINT("d", MaxTrack);
    2364           OM_PRINT("d", MaxCheck);
    2365           OM_PRINT("d", Keep);
    2366           OM_PRINT("d", HowToReportErrors);
    2367           OM_PRINT("d", MarkAsStatic);
    2368           OM_PRINT("u", PagesPerRegion);
    2369           OM_PRINT("p", OutOfMemoryFunc);
    2370           OM_PRINT("p", MemoryLowFunc);
    2371           OM_PRINT("p", ErrorHook);
     2361        OM_PRINT("d", MinTrack);
     2362        OM_PRINT("d", MinCheck);
     2363        OM_PRINT("d", MaxTrack);
     2364        OM_PRINT("d", MaxCheck);
     2365        OM_PRINT("d", Keep);
     2366        OM_PRINT("d", HowToReportErrors);
     2367        OM_PRINT("d", MarkAsStatic);
     2368        OM_PRINT("u", PagesPerRegion);
     2369        OM_PRINT("p", OutOfMemoryFunc);
     2370        OM_PRINT("p", MemoryLowFunc);
     2371        OM_PRINT("p", ErrorHook);
    23722372#undef OM_PRINT
    23732373#endif
    23742374
    2375 
    2376 
    23772375#ifdef OM_ERROR_H
    2378           Print("\n\n[om_ErrorStatus]        : '%s' (%s)\n",
     2376        Print("\n\n[om_ErrorStatus]        : '%s' (%s)\n",
    23792377                omError2String(om_ErrorStatus),
    23802378                omError2Serror(om_ErrorStatus));
    2381           Print("[om_InternalErrorStatus]: '%s' (%s)\n",
     2379        Print("[om_InternalErrorStatus]: '%s' (%s)\n",
    23822380                omError2String(om_InternalErrorStatus),
    23832381                omError2Serror(om_InternalErrorStatus));
    23842382
    2385 //          PrintS("Trying to check the omalloc memory system: ");
    2386           {
    2387             omError_t ret = _omDebugMemory(10, OM_FL);
    2388             Print("[omDebugMemory()]       : '%s' (%s)\n", omError2String(ret), omError2Serror(ret));
    2389           }
    2390 #endif
    23912383#endif
    23922384
    23932385//        omTestMemory(1);
    23942386//        omtTestErrors();
    2395           return FALSE;
    2396         }
    2397         else
     2387        return FALSE;
     2388      }
     2389      else
     2390#endif
    23982391  /*==================== naIdeal ==================================*/
    23992392      if(strcmp(sys_cmd,"naIdeal")==0)
  • Singular/iparith.cc

    r7ec0614 ra53ae5  
    6969#include <Singular/ipshell.h>
    7070#include <kernel/mpr_inout.h>
     71
     72#ifdef HAVE_FANS
    7173#include <gfanlib/gfanlib.h>
     74#endif
    7275
    7376#include <kernel/timer.h>
  • Singular/ipid.cc

    r7ec0614 ra53ae5  
    2929#include <kernel/syz.h>
    3030#include <Singular/ipid.h>
     31
     32#ifdef HAVE_FANS
    3133#include <gfanlib/gfanlib.h>
     34#endif
    3235
    3336#ifdef HAVE_DYNAMIC_LOADING
     
    226229}
    227230
    228 //#define KAI
    229 idhdl enterid(const char * s, int lev, int t, idhdl* root, BOOLEAN init)
     231idhdl enterid(const char * s, int lev, int t, idhdl* root, BOOLEAN init, BOOLEAN search)
    230232{
    231233  idhdl h;
     
    252254    }
    253255  }
    254   // is it already defined in idroot ?
    255   else if (*root != IDROOT)
    256   {
    257     if ((h=IDROOT->get(s,lev))!=NULL)
    258     {
    259       if (IDLEV(h)==lev)
    260       {
    261         if ((IDTYP(h) == t)||(t==DEF_CMD))
    262         {
    263           if (BVERBOSE(V_REDEFINE))
    264             Warn("redefining %s **",s);
    265           if (s==IDID(h)) IDID(h)=NULL;
    266           killhdl2(h,&IDROOT,NULL);
    267         }
    268         else
    269           goto errlabel;
    270       }
    271     }
    272   }
    273256  // is it already defined in currRing->idroot ?
    274   else if ((currRing!=NULL)&&((*root) != currRing->idroot))
     257  else if (search && (currRing!=NULL)&&((*root) != currRing->idroot))
    275258  {
    276259    if ((h=currRing->idroot->get(s,lev))!=NULL)
     
    290273    }
    291274  }
     275  // is it already defined in idroot ?
     276  else if (search && (*root != IDROOT))
     277  {
     278    if ((h=IDROOT->get(s,lev))!=NULL)
     279    {
     280      if (IDLEV(h)==lev)
     281      {
     282        if ((IDTYP(h) == t)||(t==DEF_CMD))
     283        {
     284          if (BVERBOSE(V_REDEFINE))
     285            Warn("redefining `%s` **",s);
     286          if (s==IDID(h)) IDID(h)=NULL;
     287          killhdl2(h,&IDROOT,NULL);
     288        }
     289        else
     290          goto errlabel;
     291      }
     292    }
     293  }
    292294  *root = (*root)->set(s, lev, t, init);
    293295#ifndef NDEBUG
     
    303305    return NULL;
    304306}
    305 
    306307void killid(const char * id, idhdl * ih)
    307308{
     
    502503  //  general  -------------------------------------------------------------
    503504  // now dechain it and delete idrec
    504 #ifdef KAI
    505   if(h->next != NULL)
    506     Print("=======>%s(%x) -> %s<====\n", IDID(h), IDID(h), IDID(h->next));
    507   else
    508     Print("=======>%s(%x)<====\n", IDID(h), IDID(h));
    509 #endif
    510 
    511505  if (IDID(h)!=NULL) // OB: ?????
    512506    omFree((ADDRESS)IDID(h));
     
    825819  return NULL;
    826820}
     821>>>>>>> .r13569
  • Singular/ipid.h

    r7ec0614 ra53ae5  
    8484char *idhdl2id(idhdl pck, idhdl h);
    8585void  iiname2hdl(const char *name, idhdl *pck, idhdl *id);
    86 idhdl enterid(const char * a, int lev, int t, idhdl* root, BOOLEAN init=TRUE);
     86idhdl enterid(const char * a, int lev, int t, idhdl* root, BOOLEAN init=TRUE, BOOLEAN serach=TRUE);
    8787idhdl ggetid(const char *n);
    8888idhdl ggetid(const char *n, BOOLEAN local, idhdl *packhdl);
  • Singular/libparse.cc

    r7ec0614 ra53ae5  
    16241624             {
    16251625               h0 = enterid( proc, 0 /*myynest*/, PROC_CMD,
    1626                                  &(IDPACKAGE(pl)->idroot), TRUE);
     1626                                 &(IDPACKAGE(pl)->idroot), TRUE, !p_static);
    16271627               if (h0==NULL) return(1);
    16281628               if((!p_static) && autoexport)
  • Singular/libparse.l

    r7ec0614 ra53ae5  
    323323             {
    324324               h0 = enterid( proc, 0 /*myynest*/, PROC_CMD,
    325                                  &(IDPACKAGE(pl)->idroot), TRUE);
     325                                 &(IDPACKAGE(pl)->idroot), TRUE, !p_static);
    326326               if (h0==NULL) return(1);
    327327               if((!p_static) && autoexport)
Note: See TracChangeset for help on using the changeset viewer.