~sircmpwn/hare#410: 
harec: add -Fstrictoom flag

This would not permit the user to utilize any code which would abort on an allocation failure.

The build driver should pass the -F options like this through to harec unmolested.

Status
RESOLVED CLOSED
Submitter
~sircmpwn
Assigned to
No-one
Submitted
3 years ago
Updated
1 year, 1 month ago
Labels
harec

~ecs 3 years ago

Another option is to have projects which want -Fstrictoom instead not provide rt::malloc and rt::ensure, opting to provide their allocator somewhere else - say, mem::vmalloc. This way, any builtins which would abort on allocation failure would cause link-time errors since they use rt::malloc/rt::ensure.

This wouldn't really work for non-freestanding code, but I can't think of a scenario in which a hosted program would want -Fstrictoom.

~sircmpwn 3 years ago

I don't like that approach because alloc provides strong typing and initialization guarantees that a call to rt::vmalloc(n: size) nullable *void would not.

~sircmpwn 3 years ago

Oh, and -Fstrictoom can give better error messages than a linker error would.

~autumnull 1 year, 1 month ago

~sebsite REPORTED CLOSED 1 year, 1 month ago

Closing this since the current plan is to make handling allocation failure mandatory, so a flag isn't necessary

Register here or Log in to comment, or comment via email.