Opened 16 years ago
Closed 16 years ago
#3349 closed bug (fixed)
After an error while allocating a large memory space with sbrk, a small memory area could not be allocated anymore
Reported by: | oco | Owned by: | axeld |
---|---|---|---|
Priority: | normal | Milestone: | R1 |
Component: | System/libroot.so | Version: | R1/pre-alpha1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
A freepascal test case allocate a large space to check if the outofmemory exception is raised properly.
Under Haiku, i still use sbrk for memory allocation (like on beos as there was no mmap).
The exception is raised as expected, but it seems freepascal need some more memory to handle the exception, and this small allocation fail under Haiku (it works under BeOS).
I think we should restore previous heap size after an error when resizing the heap area. If not, the small allocation call will try to allocate the memory asked in the previous one + the small area. As the call has failed earlier, there is a good chance that resize_area will fail again with a little larger space asked.
Attachments :
- A C program to reproduce this problem
- a patch to solve this problem
Attachments (3)
Change History (5)
by , 16 years ago
Attachment: | test_mem.c added |
---|
by , 16 years ago
Attachment: | arch_int.c_r28821.diff added |
---|
by , 16 years ago
Attachment: | arch-specific.cpp_r28854.diff added |
---|
arch_int.c_r28821.diff is a mistake : please ignore...