unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: "Mike Gran" <spk121@yahoo.com>
To: David Pirotte <david@altosw.be>
Cc: guile-devel <guile-devel@gnu.org>
Subject: Re: GC Warning related to large mem block allocation - Help needed
Date: Fri, 29 Dec 2017 21:10:52 -0800	[thread overview]
Message-ID: <20171230051051.GA10643@joshua.dnsalias.com> (raw)
In-Reply-To: <20171230020521.7ab5fd73@capac>

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.

  GC_set_warn_proc(GC_ignore_warn_proc);

> 
> 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	other threads:[~2017-12-30  5:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-30  1:48 GC Warning related to large mem block allocation - Help needed David Pirotte
2017-12-30  2:35 ` David Pirotte
2017-12-30  4:05 ` David Pirotte
2017-12-30  5:10   ` Mike Gran [this message]
2017-12-30 23:38     ` David Pirotte
2017-12-31 13:22       ` David Pirotte
2018-01-01 14:11         ` Freja Nordsiek
2018-01-01 22:05           ` Daniel Llorens

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171230051051.GA10643@joshua.dnsalias.com \
    --to=spk121@yahoo.com \
    --cc=david@altosw.be \
    --cc=guile-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).