Commit Graph

59 Commits (release)

Author SHA1 Message Date
Björn Lindqvist 134a9fbcb4 VM: we can save the process by throwing a normal error here 2017-06-25 01:43:31 +02:00
Björn Lindqvist ee0b34a469 VM: don't need the data_roots here 2016-11-30 16:36:25 +01:00
Björn Lindqvist e4bdbf1503 VM: better init of stdin, stdout and stderr 2016-11-21 20:40:25 +01:00
Björn Lindqvist 0b6ffdc77e Revert "VM: undoing 0274e889b9 (#1513)"
This reverts commit a4802aba68.
2016-11-09 02:07:56 +01:00
Björn Lindqvist a4802aba68 VM: undoing 0274e889b9 (#1513) 2016-11-08 13:37:52 +01:00
Alexander Iljin 0d57734dab vm: replace block comments /**/ with line comments // 2016-09-09 05:47:52 +02:00
Alexander Iljin e0acf4f328 Revert "vm: replace line comments // with block comments /**/ for consintency"
This reverts commit 7ee4e5dea5.
2016-09-09 05:47:52 +02:00
Alexander Iljin 7ee4e5dea5 vm: replace line comments // with block comments /**/ for consintency
Fix #1651.
2016-08-03 09:19:48 -07:00
Björn Lindqvist 0274e889b9 VM: refactor tagged.hpp so it's not dependent on the factor_vm class
this way untag<byte_array>(relocation) can be used in code_blocks.hpp
2015-11-24 16:00:50 +01:00
Björn Lindqvist 2536b6cd93 VM: fix move_file called from save_image
save_image() shouldn't throw exceptions because if the 'then_die'
argument is t it would leave factor in an inconsistent state. So
therefore move_file() should be fixed and raw_fclose() called instead of
safe_fclose().
2015-09-29 23:13:10 +02:00
Björn Lindqvist a53d5be683 VM: make allot_alien() and ffi_dlsym() use cell instead of void*
this way we get rid of a bunch of superfluous casts
2015-08-23 18:36:31 -07:00
Björn Lindqvist 40b7805e0a VM: fixes so that raw_fread and safe_fread returns a size_t again 2015-06-05 02:14:49 +02:00
Björn Lindqvist 0713f28bdb VM: safe_fread needs to return an int so you can return -1 on error 2015-06-05 02:14:49 +02:00
Björn Lindqvist f1ca83524a VM: new functions raw_fclose and raw_fread
These need to be used when the image is loaded because there is no
context so you can't throw io errors yet.
2015-06-05 02:14:49 +02:00
Doug Coleman 27590b514c vm: Only call fclose() once. Rename io_error() to io_error_if_not_EINTR() to be more explicit.
Fixes #1335.
2015-06-03 14:35:48 -07:00
Doug Coleman c675694619 vm: Annotate more places where we can gc.
Code formatting fix.
2014-11-29 19:25:46 -06:00
Björn Lindqvist 60b7631e76 VM: fixing some implicit casts from cell to fixnum
The types are compatible, but it looks a little nicer if the variable
that receives a return value declared as cell also is a cell.
2014-07-10 07:54:07 -07:00
Erik Charlebois ffe41b3d7f VM: Fixup cast formatting after clang-format
clang-format doesn't recognize casts to non-pointer/non-template types
so it winds up adding a space between the right paren and the expression
and then failing to recognize prefix operators in the process
(e.g. foo = (cell) & bar; should be foo = (cell)&bar;). This commit
manually fixes up the major cases (fixnum, cell, all types ending in _t).
2013-05-13 14:59:24 -04:00
Erik Charlebois 894e181f31 VM: Refactor io.cpp/hpp to Factor style 2013-05-12 13:24:45 -04:00
Erik Charlebois ca2ea548be VM: Remove exec bit from VM source files 2013-05-11 17:04:23 -04:00
John Benediktsson 17945addfe vm: use ctx->push since unbox_array_size needs to peek at the stack. 2013-03-22 09:19:36 -07:00
John Benediktsson 5be15d7e3f vm: more use of ctx->replace(). 2013-03-22 09:17:02 -07:00
Doug Coleman 000efd9bbb vm: Add messages about things that can allocate. Fix a gc bug in the primitive for quotation-code. 2012-08-15 21:30:55 -07:00
Joe Groff 8e66c7abee vm: clean up windows ctrl-handler 2011-10-27 21:18:22 -07:00
Joe Groff fde782cff6 vm: non-copying primitive_fread
primitive_fread now takes a buffer pointer argument and returns a count of bytes read instead of allocating a byte array.
2011-10-17 21:22:57 -07:00
Slava Pestov f1bec796bb vm: C I/O streams became unusable after a single EOF (reported by John Benediktsson) 2010-08-22 20:56:29 -07:00
Joe Groff ec6c2ccc3e silence more msvc warnings 2010-05-05 22:32:45 -07:00
Slava Pestov 216a05e68a vm: small cleanup 2010-04-13 21:24:42 -07:00
Slava Pestov 11ddbc03a4 vm: signal handling cleanup 2010-03-27 07:33:28 -04:00
Doug Coleman dad3870abd Use for(;;) instead of do/while in a few places, fix safe_fread's error handling 2010-02-24 02:50:41 -06:00
Slava Pestov af0ddd5985 Specialized arrays, structs and other objects responding to the >c-ptr / byte-length protocol can now be written to binary streams 2010-02-24 20:18:41 +13:00
Slava Pestov c08fa9cb6e vm: disable silly nano-count workaround on Win64, fix some indentation issues 2010-02-06 00:45:29 -06:00
Doug Coleman 06f02d1314 Refactor error handling in io.cpp. Update image.cpp and header files for changes. 2010-02-04 23:53:54 -06:00
Doug Coleman a2ce57d856 Allow setting errno instead of just clearing it 2010-02-03 17:20:24 -06:00
Doug Coleman 7c40fc1a36 unix-system-call io-error -> unix-system-call drop
make unix.ffi, unix.ffi.linux unportable
fix spacing in io.cpp before refactoring
2010-01-23 09:07:35 -06:00
Doug Coleman bbd4e27275 Tighten up libc file io code to avoid EINTR problems 2010-01-22 12:59:14 -06:00
Slava Pestov 63edd20a55 vm: eliminating register variables work in progress. Works on x86-32 with non-optimizing compiler 2009-12-19 10:59:56 +13:00
Slava Pestov 6c2c87758a vm: rename gc_root to data_root, add code_root to fix a problem where code blocks would move underneath the PIC compiler if PIC compiler allocated enough 2009-11-02 18:10:34 -06:00
Slava Pestov 810e309e0c vm: rename userenv to special_objects 2009-10-23 00:33:53 -05:00
Slava Pestov d85d84697a Change data heap alignment to 16 bytes 2009-10-20 12:45:00 -05:00
Slava Pestov 236588208b vm: rename F to false_object, and rename T to true_object 2009-10-18 20:26:21 -05:00
Doug Coleman 11d55131de add ftell primitive 2009-10-03 18:20:35 -05:00
Phil Dawes 9b7412b8f8 Moved PRIMITIVE and PRIMITIVE_FORWARDs to primitives.[ch]pp 2009-09-27 19:42:18 +01:00
Phil Dawes 6b7717bf37 forwarding functions replaced with PRIMITIVE_FORWARD() macro 2009-09-25 20:43:01 +01:00
Phil Dawes 83b0769eef renamed factorvm to factor_vm 2009-09-24 08:16:52 +01:00
Phil Dawes e566656e46 removed a bunch of superflous blank lines 2009-09-24 08:02:14 +01:00
Phil Dawes e3ac531fdb renamed vmprim_ to primitive_ 2009-09-24 08:02:13 +01:00
Phil Dawes 65a264aa1f turned errno() methods back into functions since they should already be thread safe 2009-09-16 08:16:32 +01:00
Phil Dawes 0397f92569 removed some global functions from io.cpp 2009-09-16 08:16:28 +01:00
Phil Dawes 82e1ea7110 vm ptr passed to untag_check 2009-09-16 08:16:26 +01:00