| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
Move implementation specific parts of heap.h and heap.inl into new
header file heapimpl.h. The heap.h contains now only the application
visible API.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Script does what is expected and tries to do it as
smartly as possible.
+ remove occurrences of two blank comment lines
next to each other after Id string line removed.
+ remove entire comment blocks which only exited to
contain CVS Ids
+ If the processing left a blank line at the top of
a file, it was removed.
|
|
|
|
|
|
|
| |
* score/src/heapfree.c, score/src/heapresizeblock.c: PR 1746. Move
protection block checks to after the block address has been
checked as a valid heap address. Add a special case in the heap
free for a NULL address.
|
|
|
|
|
|
|
|
|
| |
PR 1672/cpukit
* score/include/rtems/score/heap.h, score/src/heap.c,
score/src/heapallocate.c, score/src/heapextend.c,
score/src/heapfree.c, score/src/heapresizeblock.c,
score/src/heapsizeofuserarea.c: Added heap protection in case
RTEMS_DEBUG is defined.
|
|
|
|
|
|
|
|
|
| |
* score/include/rtems/score/heap.h, score/inline/rtems/score/heap.inl,
score/src/heapallocate.c, score/src/heap.c, score/src/heapextend.c,
score/src/heapresizeblock.c, score/src/heapwalk.c: Documenation.
Simplified block resize. Improved heap walk. Changed heap layout to
avoid a special case for _Heap_Is_used() and _Heap_Is_free().
* libmisc/stackchk/check.c: Update for heap API changes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* libcsupport/src/free.c, libmisc/stackchk/check.c,
rtems/include/rtems/rtems/region.h, rtems/src/regioncreate.c,
rtems/src/regionextend.c, rtems/src/regiongetinfo.c,
rtems/src/regiongetsegment.c, rtems/src/regiongetsegmentsize.c,
rtems/src/regionresizesegment.c, score/src/pheapallocate.c,
score/src/pheapallocatealigned.c, score/src/pheapextend.c,
score/src/pheapfree.c, score/src/pheapgetblocksize.c,
score/src/pheapgetfreeinfo.c, score/src/pheapgetinfo.c,
score/src/pheapgetsize.c, score/src/pheapinit.c,
score/src/pheapresizeblock.c, score/src/pheapwalk.c:
Update for heap API changes.
* score/include/rtems/score/apimutex.h,
score/include/rtems/score/object.h: Documentation.
* score/include/rtems/score/heap.h,
score/include/rtems/score/protectedheap.h,
score/inline/rtems/score/heap.inl, score/src/heap.c,
score/src/heapallocate.c, score/src/heapallocatealigned.c,
score/src/heapextend.c, score/src/heapfree.c,
score/src/heapgetfreeinfo.c, score/src/heapgetinfo.c,
score/src/heapresizeblock.c, score/src/heapsizeofuserarea.c,
score/src/heapwalk.c: Overall cleanup. Added boundary constraint to
allocation function. More changes follow.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* libmisc/stackchk/check.c, rtems/src/regionreturnsegment.c,
rtems/src/regiongetsegmentsize.c, src/heapalignupuptr.c,
src/heapallocatealigned.c, src/heapallocate.c, src/heap.c,
src/heapextend.c, src/heapfree.c, src/heapgetfreeinfo.c,
src/heapgetinfo.c, src/heapresizeblock.c, src/heapsizeofuserarea.c,
src/heapwalk.c, src/pheapgetblocksize.c, inline/rtems/score/heap.inl,
include/rtems/score/heap.h: Overall cleanup. Changed all types for
addresses, sizes, offsets and alignments to uintptr_t. Reformatted.
Added variables for clarity. Renamed various objects. Enabled
_HAssert() for all instances. More changes follow.
|
|
|
|
|
| |
* score/src/heapresizeblock.c: Remove printk's that were accidentally
committed.
|
|
|
|
|
| |
* score/inline/rtems/score/heap.inl, score/src/heapresizeblock.c:
Simplify routine.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* libcsupport/src/realloc.c, rtems/include/rtems/rtems/region.h,
rtems/src/regioncreate.c, rtems/src/regionextend.c,
rtems/src/regiongetsegment.c, rtems/src/regiongetsegmentsize.c,
rtems/src/regionmp.c, rtems/src/regionresizesegment.c,
sapi/include/rtems/config.h, score/include/rtems/score/heap.h,
score/include/rtems/score/protectedheap.h, score/src/heap.c,
score/src/heapallocate.c, score/src/heapallocatealigned.c,
score/src/heapextend.c, score/src/heapresizeblock.c,
score/src/heapsizeofuserarea.c, score/src/pheapallocate.c,
score/src/pheapallocatealigned.c, score/src/pheapextend.c,
score/src/pheapgetblocksize.c, score/src/pheapresizeblock.c: Change
sizes of heap/region and allocated objects in heap to intptr_t so
they can be larger than a single allocatable object (e.g. size_t).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* score/include/rtems/score/heap.h,
score/include/rtems/score/protectedheap.h,
score/include/rtems/score/wkspace.h, score/src/heap.c,
score/src/heapallocate.c, score/src/heapallocatealigned.c,
score/src/heapextend.c, score/src/heapresizeblock.c,
score/src/heapsizeofuserarea.c, score/src/pheapgetblocksize.c,
score/src/wkspace.c: Revert use of ssize_t. This type is not
guaranteed to be able to represent a positive number greater than the
size of a single allocatable object. We needed a type that is able to
represent the size of a pool of multiple allocatable objects or
potentially nearly all memory.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* libcsupport/src/malloc_statistics_helpers.c,
libcsupport/src/realloc.c, rtems/include/rtems/rtems/region.h,
rtems/include/rtems/rtems/support.h,
rtems/src/regiongetsegmentsize.c, rtems/src/regionresizesegment.c,
rtems/src/workspace.c, sapi/include/confdefs.h,
score/include/rtems/score/heap.h,
score/include/rtems/score/protectedheap.h,
score/include/rtems/score/wkspace.h, score/src/heap.c,
score/src/heapallocate.c, score/src/heapallocatealigned.c,
score/src/heapextend.c, score/src/heapresizeblock.c,
score/src/heapsizeofuserarea.c, score/src/pheapgetblocksize.c,
score/src/wkspace.c: Change size_t to ssize_t on all Heap, Workspace
and Region calls. On 16-bit architectures, size_t can be 16-bits
which would limit sizes to 64K.
|
| |
|
| |
|
| |
|
|
PR 746/rtems
Optimize realloc(). The problem is that realloc() can neither grow
nor shrink efficiently the current memory region without support
from underlying heap/region modules. The patch introduces one new
routine for each of heap and region modules, _Heap_Resize_block(),
and rtems_region_resize_segment(), respectively, and uses the
latter to optimize realloc().
The implementation of _Heap_Resize_block() lead to changing of the
heap allocation strategy: now the heap manager, when splits larger
free block into used and new free parts, makes the first part of
the block used, not the last one as it was before. Due to this new
strategy, _Heap_Resize_block() never needs to change the user
pointer.
Caveat: unlike previous heap implementation, first few bytes of
the contents of the memory allocated from the heap are now almost
never all zero. This can trigger bugs in client code that have not
been visible before this patch.
* libcsupport/src/malloc.c (realloc): try to resize segment in
place using new rtems_region_resize_segment() routine before
falling back to the malloc()/free() method.
* score/src/heap.c:
(_Heap_Initialize): change initial heap layout to reflect new
allocation strategy of using of the lower part of a previously
free block when splitting it for the purpose of allocation.
(_Heap_Block_allocate): when split, make the lower part used, and
leave the upper part free. Return type changed from Heap_Block* to
uint32_t.
* score/include/rtems/score/heap.h:
(Heap_Statistics): added 'resizes' field.
(Heap_Resize_status): new enum.
(_Heap_Resize_block): new routine.
(_Heap_Block_allocate): return type changed from Heap_Block* to
uint32_t.
* score/src/heapwalk.c: reflect new heap layout in checks.
* score/src/heapsizeofuserarea.c: more assertions added.
* score/src/heapresizeblock.c: new file.
(_Heap_Resize_block): new routine.
* score/src/heapfree.c: reverse the checks _Heap_Is_block_in() and
_Heap_Is_prev_used() on entry to be in this order.
* score/src/heapallocate.c, score/src/heapallocatealigned.c:
ignore return value of _Heap_Block_allocate().
* score/Makefile.am (HEAP_C_FILES): added src/heapresizeblock.c.
* rtems/include/rtems/rtems/region.h:
(rtems_region_resize_segment): new interface routine.
(_Region_Process_queue): new internal routine called from
rtems_region_resize_segment() and rtems_region_return_segment().
* rtems/src/regionreturnsegment.c: move queue management code into
the new internal routine _Region_Process_queue() and call it.
* rtems/src/regionresizesegment.c: new file.
(rtems_region_resize_segment): new interface routine.
* rtems/src/regionprocessqueue.c: new file.
(_Region_Process_queue): new internal routine containing queue
management code factored out from 'regionreturnsegment.c'.
* rtems/Makefile.am (REGION_C_FILES): Added
src/regionresizesegment.c, and src/regionprocessqueue.c.
* ada/rtems.adb, ada/rtems.ads: Added Region_Resize_Segment.
|