Commit Graph

204 Commits

Author SHA1 Message Date
Edwin Brady
7831e10f1c Check messages are passed to active VMs
As currently implemented, this will leak a few bytes per VM after they
terminate, but it is at least better than segfaulting when sending
messages to VMs which have terminated.
2015-07-11 23:11:59 +01:00
Heather
45420ab2fd fix building for windows/idris_stdfgn.c
reflect this change: dc277394ee
2015-07-03 16:24:14 +04:00
Edwin Brady
dc277394ee Fix 'time' to return Integer rather than Int
This way, the time in seconds actually fits...
2015-07-01 13:56:57 +01:00
Edwin Brady
3760508ced Add a timeout to checkMessages 2015-06-20 23:44:55 +01:00
Christopher Schwaab
2b0224aa2f Add AR and RANLIB envs for exherbo multiarch. 2015-05-21 16:52:00 +01:00
Edwin Brady
f8cb234577 Reading from a file shouldn't strip \n
We need to get exactly what's in the file or strange things might happen
and assumptions get broken.
Change getLine to strip newlines itself rather than have the RTS do it,
for consistency with the REPL behaviour.
2015-05-16 14:03:13 +01:00
Markus Pfeiffer
141336515b Remove more Buffer leftovers 2015-05-05 00:59:10 +01:00
Markus Pfeiffer
6e7adb87ac Remove include file related to SSE data 2015-05-05 00:36:57 +01:00
Markus Pfeiffer
1a6f20ff33 Remove some leftovers from the rts
This commit
* removes some leftovers of Buffers from the rts
* removes the pointer-to-128bit type from Closure
* updates a docstring
2015-05-05 00:23:38 +01:00
Niklas Larsson
6b0aa53bc5 Don't use -fPIC on Windows
It generates a bunchh of warnings there.
2015-05-01 21:39:11 +02:00
Edwin Brady
f6414691de Merge pull request #2143 from soimort/getLine-inconsistency
Fix getLine inconsistency
2015-04-14 20:10:50 +01:00
Mort Yao
b9190ca6cd rts: fix unreachable free(buffer) 2015-04-13 21:36:26 +08:00
Mort Yao
1cb10f9a52 Remove newline character from the result of getline.
- Fix #2073 getLine inconsistent behaviour
- getLine no longer keeps the newline character
2015-04-13 21:10:25 +08:00
Niklas Larsson
610387c171 Add a new Closure type for raw data and have that be allocated
with idris_alloc.
2015-04-10 10:12:31 +02:00
Heather
44ce3873f8 rts: add getline to Makefile 2015-04-01 13:28:28 +04:00
Ahmad Salim Al-Sibahi
b531d09451 Checked error conditions and freed buffer after use 2015-03-30 22:13:52 +02:00
Ahmad Salim Al-Sibahi
e63f31867f Added BSD licensed getline and used that to read string from file 2015-03-30 21:57:34 +02:00
Edwin Brady
3ec54f8f4c Remove some GPLed code
The replacement doesn't actually work properly, so needs to be fixed
asap, but if we have code that violates a licence it really has to go as
soon as we find out.
2015-03-30 20:31:59 +01:00
Edwin Brady
847296659b Remove Buffer/BitVectors from compiler/C rts 2015-03-28 18:29:59 +00:00
Edwin Brady
c4132807f0 String in C is now UTF8 encoded
Primitives for head/tail/index/cons/reverse/length now all assume the
char* is UTF8 encoded.  Also updated generation of literals to encode as
UTF8.  Primitives are probably not as efficient as they could be (though
some of the will be used rarely)

ASCII strings will work exactly as before.

Everything I know about UTF8 encoding has been learned in the past few
hours. Therefore, this is unlikely to be the best way to do this. Please
educate me, ideally in the form of annotated Pull Requests :).
2015-03-28 17:13:59 +00:00
David Raymond Christiansen
5ed857b100 Merge remote-tracking branch 'refs/remotes/upstream/master' into ahmadsalim-testing/cstaticanalysis 2015-03-19 20:46:24 +01:00
Edwin Brady
e5b50de7e2 Merge pull request #1968 from Chobbes/heap_fixes
Generalized alloc_heap so it could be reused for garbage collection.
2015-03-19 19:30:56 +00:00
Edwin Brady
03b75166a5 Revert "GC check allocation of new heap." 2015-03-19 19:00:23 +00:00
Edwin Brady
446d99d74a Merge pull request #1967 from Chobbes/gc_malloc
GC check allocation of new heap.
2015-03-19 18:08:28 +00:00
David Raymond Christiansen
e4358f0966 Fix cppcheck error and make more robust
cppcheck now excludes imported library code from other projects and (for
now) the Windows RTS. Everything also passes, so #1907 is superseded and
fulfilled.
2015-03-16 21:18:54 +01:00
Edwin Brady
d4371e69c3 Generate interface files for C->Idris calls
--interface command line option will generate header files from any
FFI_Export structures, and compile as a .o rather than as an executable.
2015-03-07 22:09:51 +00:00
Edwin Brady
f7ac46acbc Merge pull request #1953 from Chobbes/stats_fix
uint32_t type needed even if stats are not enabled.
2015-03-05 22:19:27 +00:00
Edwin Brady
c4220098e6 Merge pull request #1951 from Chobbes/setheap_fix
SETHEAP macro fix.
2015-03-05 22:15:57 +00:00
Calvin Beck
8f9ac37a02 Generalized alloc_heap so it could be reused for garbage collection. 2015-02-28 14:41:22 -07:00
Calvin Beck
d6d07ff197 GC check allocation of new heap. 2015-02-28 13:12:45 -07:00
Calvin Beck
954d071de4 Fixed format string in heap allocation error. 2015-02-28 12:51:07 -07:00
Calvin Beck
1b7ce8002a uint32_t type needed even if stats are not enabled. 2015-02-25 21:42:43 -07:00
Calvin Beck
a5efe0b0d8 SETHEAP macro did not use argument. 2015-02-25 20:34:34 -07:00
Calvin Beck
78c76feec1 Removed commented out old code.
This commented out code was out of date, and would only cause errors when put back into the code. For instance the structures referenced in these comments have changed to the point where this is no longer relevant.
2015-02-25 17:03:38 -07:00
Calvin Beck
d1e0d004ab Fixed idris_gcInfo so it uses correct printf format strings / correct sizes. 2015-02-25 13:48:49 -07:00
Niklas Larsson
9fb967490c Fix Windows RTS
Fixup idris_writeStr (with name change)

Add the functionality to fpoll.
2015-02-22 20:25:40 +01:00
Heather
280665ca54 add missing HAS_PTHREAD wrapper 2015-02-18 15:49:21 +04:00
Edwin Brady
f79498dc85 Change return type of checkMessages
Useful to know who the next waiting message is from, as well as whether
there is one
2015-02-17 23:55:55 +00:00
Edwin Brady
297b3e21ad Merge branch 'master' of github.com:idris-lang/Idris-dev 2015-02-15 21:47:49 +00:00
Edwin Brady
0b6726ff49 Improve concurrency primitives in C RTS
Now allow recv to only receive from a specific sender. This way a server
(for example) can carry on a conversation with a specific process
without having to mess about with the mailbox in various error prone
ways...
2015-02-15 21:46:34 +00:00
Heather
15101555d3 clean includes from c file 2015-02-12 10:43:26 +04:00
Edwin Brady
cdfaa9f4f4 Message passing fixes in VM
requireAlloc always needs to be paried with doneAlloc or the VM may
deadlock. Also, need to set the VM we're allocating on in copyTo with
pthread_setspecific
2015-02-07 22:31:51 +00:00
Edwin Brady
9150698428 Primitive type for world state
This means we can make primitives for reading/writing file handles which
are given the world state, so can be written more safely. Also, a
minimal back end can implement these rather than implementing an entire
FFI.

Updated primitive LReadStr (which can now reasonably be total, like any
foreign function, because it has a world state) and added primitive
LWriteStr.
2015-01-18 00:14:38 +00:00
Mattias Lundell
b6b8fd27a3 Add gc copy for bit vectors 2015-01-01 23:13:05 +01:00
Mattias Lundell
6dafd1880a Added bit vectors to the C backend 2014-12-30 22:32:44 +01:00
Edwin Brady
f7b72a6732 Use idris_alloc for GMP allocation
Now storing VM in a pthread_key (in environments which support pthreads)
meaning that allocation doesn't need to be passed a VM pointer, and so
we can safely use the idris allocator from GMP (and indeed any C library
which wants to use it).
2014-12-18 00:09:25 +00:00
Miëtek Bak
f744f1c1dd Work around bug in glibc 2.11 2014-12-09 23:52:54 +00:00
Mattias Lundell
64cf1205b4 Fix GC statistics overflow 2014-11-30 21:58:20 +01:00
Edward O'Callaghan
2f9d9cb726 rts/idris_rts.c: Fix referenced after allocation that may moved away
Fixes issue #1610

Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
2014-10-15 03:17:35 +11:00
EvanR
be386bdba2 fix for bugs in the bits primitive operations
See previous commit message for the explanation of the bug.

This commit gives the right fix for the bug, which is to take out the values
that you will need from the arguments before using the allocator.  The reason
is that the allocator may trigger a GC collection which will move your
arguments away. While you can use the resulting FWD pointer to get the data,
FWD values should never be used outside of the garbage collector.  The gmp
operations should be looked at to make sure it is not doing this.

In summary, any C code that uses the allocator should save any relevant values
that its pointers are pointing to first.
2014-10-07 10:48:00 -05:00