question : I guess, this question requires some kind of memory pool and it needs to be allocated a big chunk of memory at the beginning..
But again, what is the difference between the functions createrangeallocator() and allocaterange()? is the createrangeallocator() required to create a memory pool of size length and allocaterange() supposed to return the specified amount of chunk from the above pool?
hi.. I guess, this question requires some kind of memory pool and it needs to be allocated a big chunk of memory at the beginning..
But again, what is the difference between the functions create_range_allocator() and allocate_range()? is the create_range_allocator() required to create a memory pool of size length and allocate_range() supposed to return the specified amount of chunk from the above pool?
thanks for the reply..
in that case, what does the parameter "base" mean in create_range_allocator(vaddr_t base, size_t length, size_t granularity)?
if it is the base, what should happen if the required base resides/coincides with the previously created range allocator?
in that case, what does the parameter "base" mean in create_range_allocator(vaddr_t base, size_t length, size_t granularity)?
My interpretation is that base is the base address of the memory to be parceled out by the allocator.
if it is the base, what should happen if the required base resides/coincides with the previously created range allocator?
That would be an obvious error situation. What should happen is a subjective matter. Throw an exception, document it as causing undefined behavior... there are several ways you could go.