Skip to content

runtime: add free_memory implementation for OpenBSD#23583

Merged
spytheman merged 1 commit into
vlang:masterfrom
lcheylus:openbsd-free_mem
Jan 26, 2025
Merged

runtime: add free_memory implementation for OpenBSD#23583
spytheman merged 1 commit into
vlang:masterfrom
lcheylus:openbsd-free_mem

Conversation

@lcheylus

@lcheylus lcheylus commented Jan 25, 2025

Copy link
Copy Markdown
Contributor

Implementation of free_memory function for OpenBSD => add specific implementation in vlib/runtime/free_memory_impl_openbsd.c.v

Closes #23579


Tests OK for runtime on OpenBSD/amd64

$ uname -mrs
OpenBSD 7.6 amd64

$ ./v -stats test vlib/runtime/runtime_test.v
---- Testing... ----
running tests in: /home/fox/dev/vlang.git/vlib/runtime/runtime_test.v
total memory: 4278042624
free  memory: 1288601600
      OK    [1/9]     0.018 ms     1 assert  | main.test_physical_memory()
     nr cpus: 4
      OK    [2/9]     0.008 ms     1 assert  | main.test_nr_cpus()
     nr jobs: 3
      OK    [3/9]     0.009 ms     1 assert  | main.test_nr_jobs()
    is_32bit: false
      OK    [4/9]     0.006 ms     1 assert  | main.test_is_32bit()
    is_64bit: true
      OK    [5/9]     0.008 ms     1 assert  | main.test_is_64bit()
       is_le: true
      OK    [6/9]     0.002 ms     1 assert  | main.test_is_little_endian()
       is_be: false
      OK    [7/9]     0.008 ms     1 assert  | main.test_is_big_endian()
      OK    [8/9]     0.001 ms     1 assert  | main.test_is_big_endian_different_than_is_little_endian()
      OK    [9/9]     0.001 ms     1 assert  | main.test_is_32bit_different_than_is_64bit()
     Summary for running V tests in "runtime_test.v": 9 passed, 9 total. Elapsed time: 0 ms.
        V  source  code size:      29210 lines,     785098 bytes,   277 types,    13 modules,   132 files
generated  target  code size:      10460 lines,     373742 bytes
compilation took: 772.641 ms, compilation speed: 37805 vlines/s, cgen threads: 3

 OK     861.216 ms vlib/runtime/runtime_test.v
----
Summary for all V _test.v files: 1 passed, 1 total. Elapsed time: 864 ms, on 1 job. Comptime: 0 ms. Runtime: 861 ms.

Signed-off-by: Laurent Cheylus <foxy@free.fr>
@huly-for-github

Copy link
Copy Markdown

Connected to Huly®: V_0.6-22009

@spytheman spytheman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

@spytheman spytheman merged commit 67a8c81 into vlang:master Jan 26, 2025
@lcheylus lcheylus deleted the openbsd-free_mem branch January 26, 2025 14:30
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

Successfully merging this pull request may close these issues.

vlib/runtime: implement free_memory on OpenBSD

2 participants