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

Gc.get () divides major_heap_increment by eight. #6539

Closed
vicuna opened this issue Sep 3, 2014 · 4 comments
Closed

Gc.get () divides major_heap_increment by eight. #6539

vicuna opened this issue Sep 3, 2014 · 4 comments

Comments

@vicuna
Copy link

vicuna commented Sep 3, 2014

Original bug ID: 6539
Reporter: drichman
Assigned to: @diml
Status: closed (set by @xavierleroy on 2016-12-07T10:34:40Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.02.0+beta1 / +rc1
Fixed in version: 4.02.1+dev
Category: runtime system and C interface

Bug description

Major heap increment is now stored in words or percent

extern uintnat caml_major_heap_increment; /* percent or words; see major_gc.c */

However, in caml_gc_get, the major heap increment is still divided by 8:

Store_field (res, 1,Val_long(Wsize_bsize(caml_major_heap_increment)));/* i */
@vicuna
Copy link
Author

vicuna commented Sep 3, 2014

Comment author: drichman

This leads to this behaviour:

let print x = print_int x; print_newline ()

let control = Gc.get ()
let () = print control.Gc.major_heap_increment

let () = Gc.set control
let () = print (Gc.get ()).Gc.major_heap_increment

let () = Gc.set { control with major_heap_increment = 40960 }

let () = print (Gc.get ()).Gc.major_heap_increment

$ ./temp
1
0
5120

@vicuna
Copy link
Author

vicuna commented Sep 3, 2014

Comment author: drichman

Proposed patch at #96

Thanks,
Daniel

@vicuna
Copy link
Author

vicuna commented Sep 3, 2014

Comment author: @diml

Thanks, patch applied: revision 15186.

@vicuna
Copy link
Author

vicuna commented Sep 11, 2014

Comment author: @mshinwell

Also applied for 4.02.1

@vicuna vicuna closed this as completed Dec 7, 2016
@vicuna vicuna added the stdlib label Mar 14, 2019
@vicuna vicuna assigned ghost Mar 14, 2019
@vicuna vicuna added the bug label Mar 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant