summaryrefslogtreecommitdiffstats
path: root/contrib/restricted/emscripten/system/lib/libc/emscripten_scan_stack.c
blob: c5a4417830c838fd9eed61851fea57452ec1a943 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/*
 * Copyright 2020 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

#include <emscripten.h>
#include <emscripten/stack.h>

void emscripten_scan_stack(em_scan_func func) {
  uintptr_t base = emscripten_stack_get_base();
  uintptr_t end = emscripten_stack_get_current();
  func((void*)end, (void*)base);
}