diff options
author | Ludovic Courtès <ludo@gnu.org> | 2020-01-23 21:46:28 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2020-01-23 21:46:28 +0100 |
commit | bf1f5422bdb364667d6761dd73454558d6dbf895 (patch) | |
tree | d30ef63d16f300d178db690f50aa9f036562076c /module/statprof.scm | |
parent | 1b8e9ca0e37fab366435436995248abdfc780a10 (diff) | |
download | guile-bf1f5422bdb364667d6761dd73454558d6dbf895.tar.gz |
statprof: Ensure 'call-thunk' is not inlined.
Previously, 'make-stack' calls with the inner and outer cuts arguments
would always return #f because 'call-thunk' wouldn't appear on the
stack.
* module/statprof.scm <top level>: Add self-assignment to 'call-thunk'.
Diffstat (limited to 'module/statprof.scm')
-rw-r--r-- | module/statprof.scm | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/module/statprof.scm b/module/statprof.scm index a1e0efbd7..33eac4468 100644 --- a/module/statprof.scm +++ b/module/statprof.scm @@ -1,7 +1,7 @@ ;;;; (statprof) -- a statistical profiler for Guile ;;;; -*-scheme-*- ;;;; -;;;; Copyright (C) 2009, 2010, 2011, 2013-2018 Free Software Foundation, Inc. +;;;; Copyright (C) 2009, 2010, 2011, 2013-2018, 2020 Free Software Foundation, Inc. ;;;; Copyright (C) 2004, 2009 Andy Wingo <wingo at pobox dot com> ;;;; Copyright (C) 2001 Rob Browning <rlb at defaultvalue dot org> ;;;; @@ -828,6 +828,10 @@ The return value is a list of nodes, each of which is of the type: (lambda results (apply values results)))) +;; Prevent inlining of 'call-thunk' so that it can be used to determine +;; the stack boundaries passed to 'make-stack'. +(set! call-thunk call-thunk) + (define* (statprof thunk #:key (loop 1) (hz 100) (count-calls? #f) (port (current-output-port)) full-stacks? (display-style 'flat)) |