From 2c7009b5200ff5b7462b56239c909daef8ed7910 Mon Sep 17 00:00:00 2001 From: jsdelfino Date: Sun, 14 Nov 2010 09:27:28 +0000 Subject: Port to Ubuntu server 10.10 64-bit. C++ code fixes required to compile and run on 64-bit. Update INSTALL doc and build scripts. Remove a few obsolete scripts. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1034963 13f79535-47bb-0310-9956-ffa450edef68 --- sca-cpp/trunk/kernel/gc.hpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'sca-cpp/trunk/kernel/gc.hpp') diff --git a/sca-cpp/trunk/kernel/gc.hpp b/sca-cpp/trunk/kernel/gc.hpp index 77a879629a..09dcd1e5ac 100644 --- a/sca-cpp/trunk/kernel/gc.hpp +++ b/sca-cpp/trunk/kernel/gc.hpp @@ -244,40 +244,40 @@ template T* gc_new() { } template apr_status_t gc_pool_acleanup(void* v) { - int* m = static_cast(v); - int n = *m; + size_t* m = static_cast(v); + size_t n = *m; T* t = (T*)(m + 1); - for (int i = 0; i < n; i++, t++) + for (size_t i = 0; i < n; i++, t++) t->~T(); return APR_SUCCESS; } -template T* gc_anew(apr_pool_t* p, int n) { - int* gc_anew_ptr = static_cast(apr_palloc(p, sizeof(int) + sizeof(T[n]))); +template T* gc_anew(apr_pool_t* p, size_t n) { + size_t* gc_anew_ptr = static_cast(apr_palloc(p, sizeof(size_t) + sizeof(T[n]))); assert(gc_anew_ptr != NULL); *gc_anew_ptr = n; apr_pool_cleanup_register(p, gc_anew_ptr, gc_pool_acleanup, apr_pool_cleanup_null) ; return (T*)(gc_anew_ptr + 1); } -template T* gc_anew(const gc_pool& p, int n) { +template T* gc_anew(const gc_pool& p, size_t n) { return gc_anew(pool(p), n); } -template T* gc_anew(int n) { +template T* gc_anew(size_t n) { return gc_anew(gc_current_pool(), n); } /** * Allocate an array of chars. */ -char* gc_cnew(apr_pool_t* p, int n) { +char* gc_cnew(apr_pool_t* p, size_t n) { char* gc_cnew_ptr = static_cast(apr_palloc(p, n)); assert(gc_cnew_ptr != NULL); return gc_cnew_ptr; } -char* gc_cnew(int n) { +char* gc_cnew(size_t n) { return gc_cnew(gc_current_pool(), n); } -- cgit v1.2.3