Idris2/support/refc
vfrinken b1f45f2748
RefC backend improvements (#2425)
* RefC backend improvements

1. OnCollect had the wrong number of arguments. The code creator expects
   3 arguments, but onCollect in prim.h expected 4 arguments. The first of which
   was an erased arguments. That is now fixed.

2. OnCollect did not call `newReference` when creating a new reference to the pointer
   and the freeing function

3. OnCollect and OnCollectAny still had a spurious printf statement

Those issues have been fixed, the test case can be found in
  tests/refc/garbageCollect

4. The IORef mechanism expects that the %World token will be passed around
   consistently. This is not the case. States in Control.App make use of
   IORefs, but the function created from Control.App.prim_app_bind
   had the world token erased to NULL.
   Now, IORefs are managed using a global variable,
   IORef_Storage * global_IORef_Storage;
   referenced in cBackend.h, defined in the created .c file, and set to NULL
   in main();

5. While multithreading and forking is still not supported, compiling a program
   that makes use of Control.App demands a C implementation of prim_fork.
   Files support/refc/threads.c and support/refc/threads.h provide a
   dummy implementation for it, so that Control.App programs compile and run.

A test for these 2 issues is given in tests/refc/issue2424

* format changes

to make the linter happy

* format changes

to make the linter happy

* format changes

to make the linter happy

* spelling mistake braket -> bracket

Co-authored-by: Volkmar Frinken <volkmar@onutechnology.com>
2022-04-27 13:59:32 +01:00
..
_datatypes.h RefC backend improvements (#2425) 2022-04-27 13:59:32 +01:00
buffer.c Assertions in RefC runtime 2021-07-17 03:59:32 +01:00
buffer.h Pass Buffer as char* when using C functions in RefC 2021-07-13 23:04:36 +01:00
casts.c In RefC, allocate the exact size of value subtype 2021-07-12 16:27:09 +01:00
casts.h Use pragma once instead of include guard 2021-06-28 12:05:22 +01:00
cBackend.h RefC backend improvements (#2425) 2022-04-27 13:59:32 +01:00
clock.c [ fix ] Cast CLOCKS_PER_SEC to float before division 2021-06-03 17:36:11 +01:00
clock.h Use pragma once instead of include guard 2021-06-28 12:05:22 +01:00
conCaseHelper.c Assertions in RefC runtime 2021-07-17 03:59:32 +01:00
conCaseHelper.h Use pragma once instead of include guard 2021-06-28 12:05:22 +01:00
Makefile Make RefC search for files in data dirs 2021-12-10 14:30:46 +00:00
mathFunctions.c RefC Integer Support (#1480) 2021-06-03 10:44:42 +01:00
mathFunctions.h Use pragma once instead of include guard 2021-06-28 12:05:22 +01:00
memoryManagement.c RefC backend improvements (#2425) 2022-04-27 13:59:32 +01:00
memoryManagement.h In RefC, allocate the exact size of value subtype 2021-07-12 16:27:09 +01:00
prim.c RefC backend improvements (#2425) 2022-04-27 13:59:32 +01:00
prim.h RefC backend improvements (#2425) 2022-04-27 13:59:32 +01:00
refc_util.c Assertions in RefC runtime 2021-07-17 03:59:32 +01:00
refc_util.h Assertions in RefC runtime 2021-07-17 03:59:32 +01:00
runtime.c Assertions in RefC runtime 2021-07-17 03:59:32 +01:00
runtime.h Use pragma once instead of include guard 2021-06-28 12:05:22 +01:00
stringOps.c Assertions in RefC runtime 2021-07-17 03:59:32 +01:00
stringOps.h Use pragma once instead of include guard 2021-06-28 12:05:22 +01:00
threads.c RefC backend improvements (#2425) 2022-04-27 13:59:32 +01:00
threads.h RefC backend improvements (#2425) 2022-04-27 13:59:32 +01:00