Changeset b0beb9b1 in mainline for kernel/generic/include/mm/slab.h


Ignore:
Timestamp:
2018-11-16T15:34:08Z (5 years ago)
Author:
GitHub <noreply@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d230358
Parents:
64f85f5 (diff), bcd4dd4 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-11-16 15:34:08)
git-committer:
GitHub <noreply@…> (2018-11-16 15:34:08)
Message:

Modify kernel malloc() (#58)

This new implementation places the allocation size in front of the allocated
object, instead of relying on the slab allocator being able to determine source
slab cache for an object. This should help reduce complexity of the memory
management subsystem (further changes coming).

The drawback is more memory consumed by small malloc() allocations, however that
can be mitigated by switching to an API where the user provides known object
size to deallocation (most users know it either statically or from length they
necessarily remember).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/mm/slab.h

    r64f85f5 rb0beb9b1  
    4040#include <atomic.h>
    4141#include <mm/frame.h>
    42 
    43 /** Minimum size to be allocated by malloc */
    44 #define SLAB_MIN_MALLOC_W  4
    45 
    46 /** Maximum size to be allocated by malloc */
    47 #define SLAB_MAX_MALLOC_W  22
    4842
    4943/** Initial Magazine size (TODO: dynamically growing magazines) */
Note: See TracChangeset for help on using the changeset viewer.