Ignore:
Timestamp:
Sep 24, 2008, 2:36:26 AM (16 years ago)
Author:
イグトランス (egtra)
Message:

性能がよいというdlmallocを導入。

Location:
trunk/ab5.0/abdev/BasicCompiler_Common
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/abdev/BasicCompiler_Common/Intermediate_Step1.cpp

    r735 r751  
    5555void DeleteComment(char *buffer){   //注釈「'」の取り除き
    5656    int i,i2,i3,IsStr;
    57     char *temporary=(char *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,lstrlen(buffer)+1);
     57    char *temporary=(char *)calloc(lstrlen(buffer)+1,sizeof (char));
    5858    for(i=0,i2=0,i3=0,IsStr=0;;i++,i2++){
    5959        if(buffer[i]=='\"') IsStr^=1;
     
    9999    }
    100100    lstrcpy(buffer,temporary);
    101     HeapDefaultFree(temporary);
     101    free(temporary);
    102102}
    103103void CheckParenthesis(char *buffer){
     
    372372
    373373    bool isBeforeCharDelimitation = true;
    374     temporary=(char *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,(lstrlen(buffer)+255)*2);
     374    temporary=(char *)calloc((lstrlen(buffer)+255)*2,sizeof (char));
    375375    for(i=0,i2=0,IsStr=0;;i++,i2++){
    376376        if(buffer[i]=='\"') IsStr^=1;
     
    990990    }
    991991    lstrcpy(buffer,temporary);
    992     HeapDefaultFree(temporary);
     992    free(temporary);
    993993}
    994994void DefCommandFormat(char *buffer){
     
    11821182    int i,i2;
    11831183
    1184     char *temporary;
    1185     temporary=(char *)HeapAlloc(hHeap,0,lstrlen(buffer)*2+1024);
     1184    char *temporary = (char*)malloc(strlen(buffer)*2+1024);
    11861185
    11871186    //1行Ifをブロック形式にする
     
    12131212    }
    12141213
    1215     HeapDefaultFree(temporary);
     1214    free(temporary);
    12161215}
    12171216void CheckPareCommand(void){
  • trunk/ab5.0/abdev/BasicCompiler_Common/Intermediate_Step2.cpp

    r543 r751  
    395395    char *temporary,*tempBase,temp2[VN_SIZE],*lpCommand;
    396396
    397     tempBase=(char *)HeapAlloc(hHeap,0,(lstrlen(buffer)+1)*2+8192);
     397    tempBase=(char *)malloc((lstrlen(buffer)+1)*2+8192);
    398398    temporary=tempBase+1;
    399399    temporary[0]=0;
     
    402402
    403403    CommandBufferSize=512;
    404     lpCommand=(char *)HeapAlloc(hHeap,0,CommandBufferSize);
     404
     405    lpCommand=(char *)malloc(CommandBufferSize);
    405406
    406407    while(1){
     
    417418            if(i2>=CommandBufferSize){  //バッファ領域が足りなくなった場合はバッファを増量する
    418419                CommandBufferSize+=512;
    419                 lpCommand=(char *)HeapReAlloc(hHeap,0,lpCommand,CommandBufferSize);
     420                lpCommand=(char *)realloc(lpCommand,CommandBufferSize);
    420421            }
    421422            if(buffer[i]=='\"') IsStr^=1;
     
    463464        if(buffer[i]=='\0') break;
    464465    }
    465     HeapDefaultFree(lpCommand);
     466    free(lpCommand);
    466467    lstrcpy(buffer,temporary);
    467468
    468     HeapDefaultFree(tempBase);
     469    free(tempBase);
    469470}
  • trunk/ab5.0/abdev/BasicCompiler_Common/Subroutine.cpp

    r702 r751  
    232232    //パラメータを整備
    233233    char *Parameter;
    234     Parameter=(char *)HeapAlloc(hHeap,0,lstrlen(ArrayElements)+(rightSide ? lstrlen(rightSide) : 0)+32);
     234    Parameter=(char *)malloc(lstrlen(ArrayElements)+(rightSide ? lstrlen(rightSide) : 0)+32);
    235235    lstrcpy(Parameter,ArrayElements);
    236236    if(rightSide){
     
    255255    }
    256256
    257     HeapDefaultFree(Parameter);
     257    free(Parameter);
    258258
    259259    return true;
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/BoostSerializationSupport.cpp

    r636 r751  
    4545#include <jenga/include/jenga.h>
    4646
     47#include <abdev/ab_common/include/libs.h>
     48
    4749using namespace Jenga::Common;
    4850
Note: See TracChangeset for help on using the changeset viewer.