Rockbox

  • Status Closed
  • Percent Complete
    100%
  • Task Type Patches
  • Category Operating System/Drivers
  • Assigned To No-one
  • Operating System All players
  • Severity Low
  • Priority Very Low
  • Reported Version Daily build (which?)
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by dreamlayers - 2011-11-27
Last edited by dreamlayers - 2011-11-29

FS#12412 - Remove firmware/buffer.c, move needed functionality to core_alloc.c

Now 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.

Closed by  dreamlayers
2011-11-29 01:09
Reason for closing:  Accepted
Additional comments about closing:  

Committed in r31088

Looks good.

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing