This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#12412 - Remove firmware/buffer.c, move needed functionality to core_alloc.c
Attached to Project:
Rockbox
Opened by Boris Gjenero (dreamlayers) - Sunday, 27 November 2011, 22:21 GMT+2
Last edited by Boris Gjenero (dreamlayers) - Tuesday, 29 November 2011, 02:09 GMT+2
Opened by Boris Gjenero (dreamlayers) - Sunday, 27 November 2011, 22:21 GMT+2
Last edited by Boris Gjenero (dreamlayers) - Tuesday, 29 November 2011, 02:09 GMT+2
|
DetailsNow that core_alloc is used, firmware/buffer.c is almost entirely obsolete. It's only used by core_allocator_init() to tell buflib_init() what memory to use for core_ctx. The contents of the associated header file, firmware/include/buffer.h, are also not needed. It's included by several files, but that's easy to remove. I'm attaching a patch for r31079.
There are currently no other allocations via buffer.c, and allocations could overlap with core_alloc allocations. That's because core_allocator_init() does the following: void *start = buffer_get_buffer(&size); buflib_init(&core_ctx, start, size); buffer_release_buffer(size); It tells buflib to use the memory and then releases the same memory so allocations via buffer.c can also use it. Yes, one could just remove buffer_release_buffer(size), but what's the point of an allocator which will just call panicf()? Basically, the benefits are: removing unused code, removing an opportunity for errors, and a simpler future implementation of FS#12403 (when putting .init at the start of the buffer, as kugel suggests). Note that when files are deleted, you need to rerun "make dep", or else you'll get a "make: *** No rule to make target" error. |
This task depends upon
Closed by Boris Gjenero (dreamlayers)
Tuesday, 29 November 2011, 02:09 GMT+2
Reason for closing: Accepted
Additional comments about closing: Committed in r31088
Tuesday, 29 November 2011, 02:09 GMT+2
Reason for closing: Accepted
Additional comments about closing: Committed in r31088
Looks good.