1. 17 Jul, 2021 1 commit
  2. 12 Jun, 2021 1 commit
  3. 10 Feb, 2021 2 commits
    • Marius Gerbershagen's avatar
      file.d: introduce :nonblock and :close-on-exec options for open · da26facf
      Marius Gerbershagen authored
      Maps directly to flags for open syscall. Ignored on Windows. We now
      let the user decide whether to open fifos in nonblocking mode or not.
      Manual has been extended to document the new extensions and slightly
      rearranged to put the important information first.
      da26facf
    • Marius Gerbershagen's avatar
      file.d: clean up ecl_stream_open · 3827daf4
      Marius Gerbershagen authored
      Previous implementation was messy and contained several race
      conditions (multiple open/close operations on the same file, first
      checking whether the file exists before opening it). We now always use
      a single open call and then optionally do an fdopen later
      on (exception being :rename which contains an unavoidable race
      condition between checking whether the file exists and then renaming
      it later on). Also improve error messages.
      3827daf4
  4. 29 Jan, 2021 1 commit
  5. 24 Jan, 2021 1 commit
  6. 27 Dec, 2020 2 commits
    • Marius Gerbershagen's avatar
      bytecmp: fix evaluation order of load time forms · 3cec9673
      Marius Gerbershagen authored
      
      
      We need to defer initialization forms until all dependent creation
      forms have been compiled (see CLHS make-load-form). Closes #562.
      Co-authored-by: Marius Gerbershagen's avatarMarius Gerbershagen <marius.gerbershagen@gmail.com>
      3cec9673
    • Marius Gerbershagen's avatar
      bytecmp: preserve the identity for literal objects · b730412e
      Marius Gerbershagen authored
      When a literal appears in the file multiple times its identity should be
      preserved.
      
      CLHS 3.2.4.4:
      
      > If two literal objects appearing in the source code for a single
      > file processed with the file compiler are the identical, the
      > corresponding objects in the compiled code must also be the identical.
      
      Previously, every bytecode object created during ext::bc-compile-file
      had its own vector of constants making it impossible to satisfy this
      constraint. Thus, we change ext::bc-compile-file to use the same
      constants vector for all bytecode objects from the same file. The
      simplest way to achieve this is to use the same compiler environment
      for all of the compilation process and push the read-compile loop
      into the si_bc_compile_from_stream function implemented in C.
      b730412e
  7. 23 Dec, 2020 2 commits
    • Daniel Kochmański's avatar
      si::mangle-name: return the function name from symbols_list.h · 6e0124bc
      Daniel Kochmański authored
      To achieve that we store the symbol name in a separate ecl_symbol slot called
      cname. It is initialized from the translation slot in the structure
      cl_symbol_initializer. That makes dpp and runtime always resolve function
      names to the same symbol. Fixes #534.
      6e0124bc
    • Daniel Kochmański's avatar
      refactor: remove the file symbols_list2.h · 7908ba80
      Daniel Kochmański authored
      The file symbols_list2.h was automatically generated from the file
      symbols_list.h for dpp. This commit unifies said structure definition and
      removes a step for generating symbols_list2.h.
      
      From now on at runtime the structurecl_symbol_initializer has an additional
      element storing the function name. That will help solving #543.
      7908ba80
  8. 22 Nov, 2020 1 commit
  9. 31 Oct, 2020 1 commit
  10. 02 Aug, 2020 2 commits
  11. 28 Jun, 2020 1 commit
    • Marius Gerbershagen's avatar
      fpe: fix ECL_WITH_LISP_FPE macro · 75877dd8
      Marius Gerbershagen authored
      We can't use ecl_process_env_unsafe() == NULL to check if ECL has
      booted because the return value of ecl_process_env_unsafe is
      unpredictable before ECL has booted. The reason is that
      ecl_process_env_unsafe calls pthread_getspecific with an uninitialized
      key stored in cl_env_key. But another call to pthread_setspecific
      might have already registered a key which happens to be the same as
      the not yet initialized cl_env_key, yielding a non-NULL value.
      75877dd8
  12. 15 Jun, 2020 2 commits
  13. 11 Jun, 2020 1 commit
    • Marius Gerbershagen's avatar
      stacks: fix default C stack size · 90043d20
      Marius Gerbershagen authored
      The ifdef in config-internal.h was buggy since RLIMIT_STACK is only defined after
      sys/resource.h has been included which it wasn't. This lead to the stack size always being
      increased to at least the default of 1 MB. To fix this, we move the check for RLIMIT_STACK
      to the configure script.
      90043d20
  14. 16 May, 2020 1 commit
    • Marius Gerbershagen's avatar
      cmp: add support for precompiled header files · 636cb4cf
      Marius Gerbershagen authored
      Improves compilation speed for single functions by about 40-50
      percent. Precompiled headers are specific to the compiler version and
      options in use. Due to this, we regenerate the header whenever the
      compiler configuration changes.
      636cb4cf
  15. 10 May, 2020 1 commit
  16. 08 May, 2020 1 commit
  17. 29 Apr, 2020 1 commit
  18. 25 Apr, 2020 1 commit
  19. 19 Apr, 2020 3 commits
  20. 08 Apr, 2020 1 commit
    • Daniel Kochmański's avatar
      compiler: rewrite clos::need-to-make-load-form-p · aa34ab71
      Daniel Kochmański authored
      Function is rewritten in C in compiler.d to remove a dependency
      between the bytecodes compiler and the clos module. It may be more
      performant thanks to more precise type handing, however we use a list
      instead of a hashtable, so it may be slower with lookup. To assess
      that we should run some benchmarks against real code -- rewriting C
      code to work with a hash table should be trivial.
      
      clos::need-to-make-load-form-p is now si::need-to-make-load-form-p and
      may be called from C code as si_need_to_make_load_form_p.
      aa34ab71
  21. 12 Mar, 2020 1 commit
  22. 22 Feb, 2020 1 commit
  23. 16 Feb, 2020 1 commit
    • Marius Gerbershagen's avatar
      ieee_fp: move fetestexcept checks directly after floating point calculations · 3afa3e1a
      Marius Gerbershagen authored
      The C standard allows compilers to ignore side effects of floating
      point operations unless the STDC FENV_ACCESS pragma is in effect. This
      could lead to spurious floating point exceptions being signaled
      because the C compiler optimized a calculation that would ordinarily
      not set fpe bits to one that did (observed with clang for a cast
      double to cl_fixnum).
      
      To solve this, we resurrect the ECL_MATHERR macro which was removed in
      commit cb03494a. We handle fpe bits
      only around calculations which are known to be "unsafe" in the sense
      that they can produce floating point exceptions. Before the
      calculation, all bits are unset and afterwards, we test for
      exceptions.
      
      The disadvantage of this method is that optimizations by the C
      compiler resulting in unboxed float arithmetic might lead to
      missing exceptions, because our native C compiler does not insert
      ECL_MATHERR statements around these calculations.
      3afa3e1a
  24. 12 Jan, 2020 2 commits
  25. 11 Jan, 2020 1 commit
    • Marius Gerbershagen's avatar
      ieee_fp: use explicit checks for fpe bits if feenableexcept is not declared · cb03494a
      Marius Gerbershagen authored
      Using isnan and isfinite to check for floating point exceptions
      doesn't work when we want floats to be able to have infinity or NaN as
      values, thus this option was removed with commit
      5f71f728. However, we can still use
      fetestexcept to explicitly check if floating point exceptions occurred
      even when we can't use the feenableexcept/SIGFPE signal delivery
      mechanism.
      
      Previously, we had something like this in the
      ECL_MATHERR_TEST/ECL_MATHERR_CLEAR macros, but this was not used
      consistently in our codebase (the ECL_MATHERR_TEST macro was missing
      in many places). Instead of error-prone testing at every point of
      computation, we call fetestexcept in DO_DETECT_FPE when creating a new
      float/complex float. In order to avoid having to do this twice, the
      DO_DETECT_FPE2 macro is introduced.
      
      A minor disadvantage of this strategy is that floating point
      exceptions may be signaled later than they occurred.
      cb03494a
  26. 04 Jan, 2020 2 commits
  27. 26 Dec, 2019 1 commit
    • Marius Gerbershagen's avatar
      Change handling of C stack size · d7b2dfb7
      Marius Gerbershagen authored
      Previously: unconditionally use the size from ECL_OPT_C_STACK_SIZE if
      it is larger than the OS provided value and if possible resize the
      stack at runtime.
      
      Now: Use ECL_OPT_C_STACK_SIZE if provided. Otherwise, use a) the OS
      provided value if we can resize the stack at runtime (for Unix) or b)
      the new build option ECL_DEFAULT_C_STACK_SIZE (1 MB) if we can set the
      stack size at link time (for Windows).
      d7b2dfb7
  28. 09 Dec, 2019 1 commit
  29. 08 Dec, 2019 3 commits
    • Marius Gerbershagen's avatar
      stacks.d: fix several problems with C stack · e37fafb3
      Marius Gerbershagen authored and Daniel Kochmański's avatar Daniel Kochmański committed
      ecl_cs_set_org and cs_set_size had several problems:
      -the size of the stack was estimated to be 1/2 of the actual value,
       which could lead to wrong stack overflow errors. In particular, we
       cannot assume that the stack pointer will always start at the stack
       origin and increase/decrease linearly (counterexamples could
       include callbacks from other threads).
      -despite its name, cs_set_size did not actually set the stack size
       even on systems where this is possible at runtime.
      -there were several magic numbers used.
      e37fafb3
    • Marius Gerbershagen's avatar
      unixsys: check for system() in configure · a2319d31
      Marius Gerbershagen authored and Daniel Kochmański's avatar Daniel Kochmański committed
      Don't let a non-available system() function (happens e.g. on iOS)
      prevent us from compiling ECL.
      a2319d31
    • Marius Gerbershagen's avatar
      cmp: check that number of arguments matches the declaration in symbols_list.h · fbdb0a32
      Marius Gerbershagen authored and Daniel Kochmański's avatar Daniel Kochmański committed
      We also use the *in-all-symbols-functions* variable only for
      determining which functions are to be exported during the build of ECL
      itself. Otherwise, instead of specifying manually, which Lisp
      functions are exported and in the core, we use the information from
      symbols_list.h (i.e. we let all_symbols.d initialize all core
      functions).
      fbdb0a32