History log of /fuchsia/zircon/system/utest/region-alloc/region-alloc.cpp
Revision Date Author Comments
# d1867d4f 07-Sep-2018 George Kulakowski <kulakowski@google.com>

[compiler.h] Migrate many C++ clients of countof to fbl::count_of

The latter is safer in C++, and the former is a namespace violation in
compiler.h that eventually needs to be resolved.

Test: CQ; should be no functional change
Change-Id: I9809b9fe062fd5f07226323035bf094b3f9de798


# ad7bcb35 27-Mar-2018 Christopher Anderson <cja@google.com>

[ulib][ralloc] Add a means to walk allocated regions

This adds ralloc_walk_allocated_regions and RegionAllocator::WalkAllocatedRegions
for us with debugging and statistics tracking. These methods hold the
RegionAllocator's alloc lock while callbacks are called to simplify the
possibility of locking errors on the caller's end, and to prevent
regions being recycled out from under the caller.

Change-Id: I664b3688d84d9ccbf64e4310dd700b84128ea436


# f3e2126c 12-Sep-2017 Roland McGrath <mcgrathr@google.com>

[zx] Magenta -> Zircon

The Great Renaming is here!

Change-Id: I3229bdeb2a3d0e40fb4db6fec8ca7d971fbffb94


# 59e644b1 07-Sep-2017 George Kulakowski <kulakowski@google.com>

[zircon][mxtl->fbl] Rename mxtl to fbl

Change-Id: Ie21b6498e1bfb0a7fa0315e40b9e5c3ee78646be


# fa086fac 10-Aug-2017 Mark Seaborn <mseaborn@google.com>

[utest] Remove empty-string msg args from EXPECT_*() calls in C++

The msg argument to EXPECT_*() and ASSERT_*() is optional in C++ now,
so we can drop this argument when it's an empty string.

In the earlier conversions, I only converted ASSERT_*() and forgot to
convert EXPECT_*() too.

This change also converts a few ASSERT_*() instances that appeared
since the earlier changes.

MG-905

Change-Id: I034c6d6a6b614ab0b315dcd409435c9fe9e27e6c


# 04b93454 03-Aug-2017 Mark Seaborn <mseaborn@google.com>

[utest] Remove empty-string msg args from ASSERT_TRUE() etc. calls in C++

The msg argument to ASSERT_*() is optional in C++ now, so we can drop
this argument when it's an empty string.

Apply this to the functions ASSERT_{TRUE,FALSE,NULL,NONNULL} -- these
are the ones that take one argument, besides the msg argument.

MG-905

Change-Id: I5405c4baf38d6a8d9b09c664dab85a4d41ed360f


# 4983c25c 02-Aug-2017 Mark Seaborn <mseaborn@google.com>

[utest] Remove empty-string msg args from ASSERT_*() calls in C++

The msg argument to ASSERT_*() is optional in C++ now, so we can drop
this argument when it's an empty string.

MG-905

Change-Id: I6a5d6917518f8c9c4865b761dcbefe296d54c924


# b31d7b7f 06-Jul-2017 George Kulakowski <kulakowski@google.com>

[cpp][countof] Prefer the typesafe mxtl::count_of in C++ code

Change-Id: I3e475731f6872e6daf764f31964bed9f09186c7c


# 9c455646 16-Jun-2017 George Kulakowski <kulakowski@google.com>

[utest][status] Use the MX_OK and MX_ERR_* mx_status_t names

Change-Id: Ia395c985d6d13cdad97e66d92933d13ddb75c8b8


# 3d0071cd 20-Jan-2017 John Grossman <johngro@google.com>

[region-alloc] Remove custom slab allocator from RegionAlloc

Make it use the generic mxtl::SlabAllocator<> instead

Change-Id: Ifa340d816af202fb8566b52a9e836bc55ea95e73


# 37b11110 14-Oct-2016 John Grossman <johngro@google.com>

[utils] Allow subtraction from available region in region-alloc.

Change-Id: I71ce1b2c914c21ebe8cc306a05147bff0cb7141c


# 252e54be 14-Oct-2016 John Grossman <johngro@google.com>

[utils] Allow adding overlapping regions in region-alloc

When adding regions to the set of available regions in the
region-alloc utility library, add a flag which permits the user to
specify that it is OK for the regions being added to overlap with the
existing available regions. If the flag is set, the set of regions
available for allocation will become the union of the existing regions
and the region being added.

It is still not OK to attempt to add a region which intersets any
currently allocated region.

Change-Id: I64d19bbea7197a6ef38ed92cb3743e4392d35812


# 80387c4e 23-Sep-2016 John Grossman <johngro@google.com>

[utils] Add a region allocator utility library.

Add a small utility library (and tests) to manage allocating regions
of a 64-bit space. The general idea is that a user of the library can
create an allocator and add some (non-overlapping) regions to it.
They can then allocate regions from the available regions in the
allocator, either by size and alignment requirement or by specific
base address and size.

C and C++ APIs are provided. The C++ API depends on mxtl, but does
not depend on any particular implementation of new. Instead, it
explicitly uses malloc/free under the hood. Bookkeeping allocation is
done using allocation pools which allocate and carve up slabs of
memory (placing the results on a free list) in order to minimize the
frequency of trips to the heap and avoid heap fragmentation. Limits
can be placed on the total size of a pool, and pools can be shared
across multiple allocators allowing multiple applications in the same
binary to compartmentalize their memory impact.

Change-Id: I007322b66f60c2e520e45013e9c3352a60557af0