CFX_StringData

// 你必须定义一个 `main()` 函数入口。
#include <iostream>
using namespace std;
typedef const char* FX_LPCSTR;
typedef char FX_CHAR;
typedef int FX_STRSIZE;
class CFX_Object
{
  public:
  void* operator new(size_t size, FX_LPCSTR file, int line)
  {
    return malloc(size);
  }
  
  void operator delete(void*p,FX_LPCSTR file,int size)
  {
    free(p);
  }
  void* operator new(size_t size)
  {
    return malloc(size);
  }
  void operator delete(void* p)
  {
    free(p);
  }
    void*			operator new[] (size_t size, FX_LPCSTR file, int line)
    {
        return malloc(size);
    }
    void			operator delete[] (void* p, FX_LPCSTR file, int line)
    {
        free(p);
    }
    void*			operator new[] (size_t size)
    {
        return malloc(size);
    }
    void			operator delete[] (void* p)
    {
        free(p);
    }
    void*			operator new (size_t, void* buf)
    {
        return buf;
    }
    void			operator delete (void*, void*)							{}
};
struct CFX_StringData {

    long		m_nRefs;

    FX_STRSIZE	m_nDataLength;

    FX_STRSIZE	m_nAllocLength;
    FX_CHAR		m_String[1];
   
};
 
int main()
{
 
  cout << "Hello, World!" << endl;
  return 0;
}
 

  

上一篇:jQuery结合Thymeleaf模板中的fragment标签实现Ajax异步加载数据


下一篇:operator new delete操作符重载