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

zone memory warnings don't seem to work as described in docs #304

Open
OYTIS opened this issue Nov 18, 2017 · 2 comments
Open

zone memory warnings don't seem to work as described in docs #304

OYTIS opened this issue Nov 18, 2017 · 2 comments

Comments

@OYTIS
Copy link

OYTIS commented Nov 18, 2017

I was playing with the following example from the docs:

(bind-func fill_buffer_closure_zone
  (let ((region_length 1000)
        (int_buf:i64* (zalloc region_length))
        (i:i64 0))
    (lambda ()
      (dotimes (i region_length)
        (pset! int_buf i i))
      (printf "int_buf[366] = %lld\n"
              (pref int_buf 366)))))

According to the docs it should have given me a warning about exceeding the 8Kb of the default zone size, but it compiled silently. I've tried to increase region_length gradually and it was compiling without a warning until it just segfaulted at region_length somewhere between 1G and 2G.

@digego
Copy link
Owner

digego commented Nov 19, 2017

Yes, the docs are outdated - we now automagically expand the region as required - so the docs need an update. A separate, but important issue, is that we are clearly no adequately checking for memory availability. This would be worth raising as a separate issue.

A pull request on the docs would be appreciated

@benswift
Copy link
Collaborator

Actually, there's a docs re-jig in the works - perhaps wait 1 week :) It'll soon be easier to contribute to the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants