Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrated to calloc #2080

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Migrated to calloc #2080

wants to merge 2 commits into from

Commits on Dec 18, 2020

  1. Migrated to calloc

    This commit migrated all dynamic memory allocation to `calloc` instead
    of `malloc` plus `memset` because:
     - at some places `memset` was missed and it maight be an issue,
     - `memset` is additional call, when `calloc` can be very optimized,
     - to respect Java's convention.
    
    Java convention and scala inherits it state that all allocated memory
    has zero value.
    
    Scala native allocated memory via malloc inside zone and never calls
    `memset` for freshly allocated memory, that may created unexpected and
    very difficult to hunt down issues.
    catap committed Dec 18, 2020
    Configuration menu
    Copy the full SHA
    992bfa3 View commit details
    Browse the repository at this point in the history
  2. Introduce alloc(n, size)

    This commit introduced `alloc(n, size)` inside zone that allows to easy
    allocates dynamic arrays.
    catap committed Dec 18, 2020
    Configuration menu
    Copy the full SHA
    f3c7706 View commit details
    Browse the repository at this point in the history