[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GC Warning related to large mem block allocation - Help needed

From: Mike Gran
Subject: Re: GC Warning related to large mem block allocation - Help needed
Date: Fri, 29 Dec 2017 21:10:52 -0800
User-agent: Mutt/1.9.1 (2017-09-22)

On Sat, Dec 30, 2017 at 02:05:21AM -0200, David Pirotte wrote:
> > So I am trying to understand and solve this problem. Below a (naive) 
> > attempt to
> > patch guile so it uses GC_malloc_ignore_off_page for objects > 100Kb, but 
> > that
> > did not even work: I guess I do miss most if not all of the puzzle pieces 
> > here...

If all you are doing is trying to get Guile not to issue warnings about big
allocations, I think all you need to do is put -DGC_IGNORE_WARN in the
CFLAGS when you build Guile.

If you don't or can't rebuild Guile, you might get away with including the
following somewhere early in your library.  Or it may not work. Dunno.


> Obviously (missing all the pieces of the puzzle): I see now that srfi-4 uses 
> srfi-4.c
> (thanks ijp), which calls scm_i_make_typed_bytevector, defined in 
> bytevectors.c,
> which calls make_bytevector, which calls  scm_gc_malloc_pointerless, which is
> defined as #define SCM_GC_MALLOC_POINTERLESS(size) GC_MALLOC_ATOMIC (size), 
> which I
> presume calls BDW-GC GC_malloc_atomic(nbytes)
> So, (a) the patch below is totally useless for any srfi-4 ops, and (b) it 
> would
> probably be more interesting to address this GC Warning reports for repeated 
> large block of mem with a 'global' guile approach ... which I unfortunately 
> can't
> do: I just don't have the knowledge and the experience.
> I can still try to patch srfi-4.c, for fun and locally, but even that is not 
> easy
> for me, because I read and write basic C (far from expert level), and I'm 
> quickly
> lost even just reading libguile code ...
> David

reply via email to

[Prev in Thread] Current Thread [Next in Thread]