Ignore:
Timestamp:
Aug 1, 2007, 11:19:01 PM (17 years ago)
Author:
dai_9181
Message:

MetaImplを廃止し、Metaにした。
ObjectModuleクラス、Linkerクラスを用意。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abdev/BasicCompiler_Common/src/DataTable.cpp

    r206 r256  
    88#include <stdlib.h>
    99
    10 DataTable::DataTable(){
    11     pdata = malloc( 1 );
    12     size = 0;
    13 }
    14 DataTable::~DataTable(){
    15     free( pdata );
     10void DataTable::Realloc( int size )
     11{
     12    this->buffer = (char *)realloc( this->buffer, size + 100 );
     13    this->size = size;
    1614}
    1715
    18 void DataTable::Init(){
    19     free( pdata );
    20 
    21     pdata = malloc( 1 );
    22     size = 0;
    23 }
    24 
    25 int DataTable::AddBinary( const void *pdata, int size ){
     16int DataTable::AddBinary( const void *buffer, int size ){
    2617    int retSize = this->size;
    2718
    28     this->pdata = realloc( this->pdata, this->size + size );
    29     memcpy( (char *)this->pdata + this->size, pdata, size );
    30     this->size += size;
     19    Realloc( this->size + size );
     20    memcpy( (char *)this->buffer + retSize, buffer, size );
    3121
    3222    return retSize;
     
    8979const void *DataTable::GetPtr() const
    9080{
    91     return pdata;
     81    return buffer;
    9282}
    9383int DataTable::GetSize() const
Note: See TracChangeset for help on using the changeset viewer.