~kentokushiba/spiderformysql/spider-2.0-src

« back to all changes in this revision

Viewing changes to hs_client/allocator.hpp

  • Committer: Kentoku SHIBA
  • Date: 2011-05-12 15:25:47 UTC
  • Revision ID: kentokushiba@gmail.com-20110512152547-6hb2cvwnbg7v6ax3
2.25

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
#define DENA_DELETE(x) (delete [] x)
30
30
#endif
31
31
 
 
32
#if 1
 
33
#define DENA_ALLOCA_ALLOCATE(typ, len) \
 
34
        static_cast<typ *>(alloca((len) * sizeof(typ)))
 
35
#define DENA_ALLOCA_FREE(x)
 
36
#else
 
37
#define DENA_ALLOCA_ALLOCATE(typ, len) \
 
38
        static_cast<typ *>(malloc((len) * sizeof(typ)))
 
39
#define DENA_ALLOCA_FREE(x) free(x)
 
40
#endif
 
41
 
32
42
#endif
33
43