1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

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'.
This commit is contained in:
Ludovic Courtès 2020-01-23 21:46:28 +01:00
parent 1b8e9ca0e3
commit bf1f5422bd

View file

@ -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))