Colin Paul Adams wrote:
>>>>>> "Eric" == Eric Bezault <
ericb@...> writes:
>
> Eric> So it's either a problem in the way I use Boehm's finalizer
> Eric> registration (in particular I pass a function pointer where
> Eric> a void* is expected!), or a problem in Boehm's finalization,
> Eric> or a problem in the implementation of `dispose'. I would
> Eric> favor the first alternative considering that what you say
> Eric> below.
>
> >> But note that I do not have the problem on my 32-bit system (I
> >> tried both before and after an svn update), so it might be a
> >> problem with Boehm gc 7.0 on 64-bit systems. I will try a newer
> >> version.
>
> That doesn't work (I used the 24th February version of 7.1 alpha).
Please try to use the two files attached.
--
Eric Bezault
mailto:
ericb@...
http://www.gobosoft.com/*
description:
"C functions used to access garbage collector facilities"
system: "Gobo Eiffel Compiler"
copyright: "Copyright (c) 2007-2008, Eric Bezault and others"
license: "MIT License"
date: "$Date: 2008-01-30 14:23:49 +0100 (Wed, 30 Jan 2008) $"
revision: "$Revision: 6283 $"
*/
#ifndef GE_GC_C
#define GE_GC_C
#ifdef EIF_BOEHM_GC
/*
* Call dispose routine `disp' on object `C'.
*/
void GE_boehm_dispose(void* C, void *disp) {
((void (*)(EIF_REFERENCE))disp)((EIF_REFERENCE)C);
}
#endif
#endif
/*
description:
"C functions used to access garbage collector facilities"
system: "Gobo Eiffel Compiler"
copyright: "Copyright (c) 2007-2008, Eric Bezault and others"
license: "MIT License"
date: "$Date: 2008-02-07 09:56:06 +0100 (Thu, 07 Feb 2008) $"
revision: "$Revision: 6286 $"
*/
#ifndef GE_GC_H
#define GE_GC_H
#ifdef EIF_BOEHM_GC
/*
Use the Boehm garbage collector.
See:
http://en.wikipedia.org/wiki/Boehm_GC http://www.hpl.hp.com/personal/Hans_Boehm/gc/*/
#include "gc.h"
/*
GC initialization.
*/
#define GE_init_gc() GC_INIT(); GC_enable_incremental()
/*
Memory allocation.
*/
/*
* GE_alloc allocates memory that can contain pointers to collectable objects.
*/
#define GE_alloc(x) GE_null(GC_MALLOC(x))
/*
* When defined, GE_alloc_cleared means that GE_alloc makes sure that the allocated memory is zeroed.
*/
#define GE_alloc_cleared
/*
* GE_alloc_atomic allocates memory that does not contain pointers to collectable objects.
*/
#define GE_alloc_atomic(x) GE_null(GC_MALLOC_ATOMIC(x))
/*
* When defined, GE_alloc_atomic_cleared means that GE_alloc_atomic makes sure that the allocated memory is zeroed.
*/
/* #define GE_alloc_atomic_cleared */
/*
Dispose
*/
/*
* Call dispose routine `disp' on object `C'.
*/
extern void GE_boehm_dispose(void*, void*);
/*
* Register dispose routine `disp' to be called on object `obj' when it will be collected.
*/
#define GE_register_dispose(obj, disp) GC_REGISTER_FINALIZER((void*)(obj), (void (*) (void*, void*)) &GE_boehm_dispose, (void*)(disp), NULL, NULL)
#else
/*
No garbage collector.
*/
/*
GC initialization.
*/
#define GE_init_gc() /* do nothing */
/*
Memory allocation.
*/
/*
* GE_alloc allocates memory that can contain pointers to collectable objects.
*/
#define GE_alloc(x) GE_null(malloc(x))
/*
* When defined, GE_alloc_cleared means that GE_alloc makes sure that the allocated memory is zeroed.
*/
/* #define GE_alloc_cleared */
/*
* GE_alloc_atomic allocates memory that does not contain pointers to collectable objects.
*/
#define GE_alloc_atomic(x) GE_null(malloc(x))
/*
* When defined, GE_alloc_atomic_cleared means that GE_alloc_atomic makes sure that the allocated memory is zeroed.
*/
/* #define GE_alloc_atomic_cleared */
/*
Dispose
*/
/*
* Register dispose routine `disp' to be called on object `obj' when it will be collected.
*/
#define GE_register_dispose(obj, disp) /* do nothing */
#endif
/*
Access to objects, useful with GCs which move objects in memory.
This is not the case here, since the Boehm GC is not a moving GC.
*/
/* Access object through hector */
#define eif_access(obj) (obj)
/* Freeze memory address */
#define eif_freeze(obj) (obj)
/* The C side adopts an object */
#define eif_adopt(obj) (obj)
/* The C side protects an object */
#define eif_protect(obj) (obj)
/* The C side weans adopted object */
#define eif_wean(obj) (obj)
/* Forget a frozen memory address */
#define eif_unfreeze(obj)
/* Always frozen since they do not move */
#define eif_frozen(obj) 1
/* Always frozen since they do not move */
#define spfrozen(obj) 1
#endif
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/_______________________________________________
gobo-eiffel-develop mailing list
gobo-eiffel-develop@...
https://lists.sourceforge.net/lists/listinfo/gobo-eiffel-develop