Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Fix broken os.freemem() on FreeBSD amd64 #1428

Closed
wants to merge 1 commit into from
Closed

Fix broken os.freemem() on FreeBSD amd64 #1428

wants to merge 1 commit into from

Conversation

avz
Copy link

@avz avz commented Jul 30, 2011

v_free_count defined as u_int v_free_count (struct vmmeter sys/vmmeter.h:87), but variable info defined as unsigned long, that cause error on 64-bits systems because higher 32 bits remain uninitialized.

Example:

require('os').freemem()
140737549713408

…r.h:87), but variable info defined as unsigned long, this cause error on 64-bits systems because higher 32 bits remain uninitialized
@bnoordhuis
Copy link
Member

Good catch. I suspect this is broken in Platform::GetTotalMemory() (and perhaps others) too?

@avz
Copy link
Author

avz commented Jul 31, 2011

No, Platform::GetTotalMemory() work fine - hw.physmem defined as unsigned long: { "physmem", CTLTYPE_ULONG }. And all other Platform::* working properly on my FreeBSD 8.2 amd64

@bnoordhuis
Copy link
Member

Landed in a38bda9. Thanks!

@bnoordhuis bnoordhuis closed this Aug 12, 2011
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants