From 5bf88f48fe8233955b3346ccea14f8e3fae38286 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 12 Mar 2014 00:34:10 -0700 Subject: * eval.c (plus_s, prof_s): New symbol global variables. (op_prof, me_pprof): New static functions. (eval_init): Intern prof symbol, store in prof_s. Captured interned + symbol in plus_s. Register prof operator and pprof macro. * gc.c (gc_bytes): New global variable. (more): Use nse function chk_malloc_gc_more instead of chk_malloc. (make_obj): Increment gc_bytes. * lib.c (malloc_bytes): New global variable. (chk_malloc, chk_realloc): Increment malloc_bytes. (chk_calloc): Bugfix: incorrect size in recursion into oom_realloc. Incorrect calculation of malloc_high_bound. Increment malloc_bytes. (chk_malloc_gc_more): New function. * lib.h (alloc_bytes_t): New typedef. (malloc_bytes, gc_bytes): Declared. (chk_malloc_gc_more): Declared. * stream.c (format_s): New symbol global. (stream_init): format_s inited. format_s used to register formatv function. * stream.h (format_s): Declared. * txr.1: Documented prof and pprof. * genvim.txr: Recognize reg_fun calls with intern followed by a preceding assignment or other syntax. * txr.vim: Updated. --- stream.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'stream.c') diff --git a/stream.c b/stream.c index 85c16d80..8e049212 100644 --- a/stream.c +++ b/stream.c @@ -71,6 +71,7 @@ val gid_k, rdev_k, size_k, blksize_k, blocks_k; val atime_k, mtime_k, ctime_k; val from_start_k, from_current_k, from_end_k; val real_time_k, name_k; +val format_s; static void common_destroy(val obj) { @@ -2624,6 +2625,7 @@ void stream_init(void) from_end_k = intern(lit("from-end"), keyword_package); real_time_k = intern(lit("real-time"), keyword_package); name_k = intern(lit("name"), keyword_package); + format_s = intern(lit("format"), user_package); #ifndef S_IFSOCK #define S_IFSOCK 0 @@ -2714,7 +2716,7 @@ void stream_init(void) reg_var(stdnull_s = intern(lit("*stdnull*"), user_package), make_null_stream()); - reg_fun(intern(lit("format"), user_package), func_n2v(formatv)); + reg_fun(format_s, func_n2v(formatv)); reg_fun(intern(lit("make-string-input-stream"), user_package), func_n1(make_string_input_stream)); reg_fun(intern(lit("make-string-byte-input-stream"), user_package), func_n1(make_string_byte_input_stream)); reg_fun(intern(lit("make-string-output-stream"), user_package), func_n0(make_string_output_stream)); -- cgit v1.2.3