History log of /system/bt/osi/src/allocator.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
abd70abb5e42c9431df94fe9d2c4a78a0d8d9af9 05-Feb-2016 Pavlin Radoslavov <pavlin@google.com> Replaced osi_getbuf()/osi_freebuf() with osi_malloc()/osi_free()

Removed the alternative buffer allocation osi_getbuf() / osi_freebuf()
and use instead osi_malloc() / osi_free().

Correspondingly, replaced usage of osi_freebuf_and_reset()
with osi_free_and_reset().

Bug: 24914560
Change-Id: I7a9599ba7fa900321f087da684428133eb0ddd6b
/system/bt/osi/src/allocator.c
ca57b25df827286c4996e17aefc251ecd79b33fc 05-Feb-2016 Pavlin Radoslavov <pavlin@google.com> Removed function osi_get_buf_size()

Refactored code that uses function osi_get_buf_size(), and removed
the need for that function.

Bug: 24914560
Change-Id: I0d002635024a9703acb78f47735aafc957a2b761
/system/bt/osi/src/allocator.c
20524d393e8b3bea4c573f7980cd843500b0e6a4 03-Feb-2016 Pavlin Radoslavov <pavlin@google.com> Refactor usage of osi_free() and osi_freebuf()

* Allow to call osi_freebuf(ptr) on NULL pointers. This simplifies
the code: a notable number of "if (foo != NULL)" checks are removed.
* Add new function osi_free_and_reset(p_ptr) that frees the buffer,
and explicitly resets the pointer to NULL.
This prevents unintended usage of free memory.
* Add corresponding function osi_freebuf_and_reset(p_ptr)
* Minor cleanup around usages of osi_free() and osi_freebuf()

Also:
* Removed unused function btif_gattc_cleanup()
* Replaced usage of the following functions with osi_freebuf_and_reset()
- mca_free_buf()
- utl_freebuf()
- btif_hl_free_buf()
* Replaced usage of rc_supported_event_free() with osi_freebuf()
* Replaced usage of btif_hl_get_buf() with osi_getbuf()
* Eliminate some of the osi_get_buf_size() calls

Bug: 22948224
Change-Id: Ife860658b26274da6f228d7353cb0f1531587337
/system/bt/osi/src/allocator.c
c02acb7761d2539ab83c6eff22b7de5b5da51b78 11-Jan-2016 Andre Eisenbach <eisenbach@google.com> Assert on memory allocation failure

This CL is a pre-cursor to cleaning up repeated memory allocation code
full of null-pointer checks. In the vast majority of cases in the
Bluetooth stack, a failed allocation is not recoverable and results in
undefined behaviour. By asserting, we can ensure we have a shot at
catching and fixing any issues not caused by OOM conditions.

Bug: 26494317
Change-Id: I53dff98c596068211934a1808f90de2d4484f952
/system/bt/osi/src/allocator.c
258c2538e3b62a8cdb403f2730c45d721e5292b4 28-Sep-2015 Pavlin Radoslavov <pavlin@google.com> GKI cleanup - moved GKI buffer allocation wrappers to OSI

* Moved the following GKI buffer allocation functions to OSI:
- GKI_getbuf() -> osi_getbuf()
- GKI_freebuf() -> osi_freebuf()
- GKI_get_buf_size() -> osi_get_buf_size()

For now we need the osi_getbuf() / osi_freebuf() allocation wrapper,
because we need to be able to call osi_get_buf_size() on the allocated
buffer.
In the future those should be replaced with osi_malloc() / osi_free().
Currently, the osi_malloc() buffer size internal allocation tracker
does not always track the size, hence we need the osi_getbuf() wrapper.

* Replaced GKI_MAX_BUF_SIZE with BT_DEFAULT_BUFFER_SIZE

* Added new file include/bt_common.h that can be usee to include
few files that should be included alost everywhere (e.g. bt_target.h"
NOTE: This file might be removed in the future and we should include
everywhere the right set of header files.

* Removed some of the GKI-related references

* Removed file include/gki_target.h

Change-Id: Ie87830e73143de200746d54235aa99f228a95024
/system/bt/osi/src/allocator.c
98a9641e77a247e5ba9a7f263066058d17e2b0a0 08-Jul-2015 Miao Chou <mcchou@google.com> build: Eliminate cutils/str_parms dependency from system/bt

Eliminate cutils/str_parmss dependency from system/bt by adding osi_str_parms:
- Added hash_map_utils which implements partial functions of cutils/str_parms
and uses osi/hash_map instead of cutils/hashmap.
- Updated osi/Android.mk, osi/BUILD.gn and the includes in audio_a2dp to use
osi_str_parms.
- Added unittest for hash_map_utils.

Bug: 21957864
Change-Id: I8458d9e45df6cab2b71840d24d17b9d75de9842c
/system/bt/osi/src/allocator.c
3e59b5b6f2ce1295e3e2711afcd2cdf0dd7e22b6 01-Apr-2015 Etan Cohen <etancohen@google.com> Fix build issues in bluedroid on master

Change-Id: I0d3e93ea61dd03505fe9db902ed90bdd4141cab2
/system/bt/osi/src/allocator.c
0f9b91e150e153229235c163861198e23600e636 12-Mar-2015 Sharvil Nanavati <sharvil@google.com> Use fully qualified path for OSI includes.
/system/bt/osi/src/allocator.c
c0745da4fb23eea23abac3c3cfd51cc7f1d38f6d 13-Nov-2014 Sharvil Nanavati <sharvil@google.com> Enable allocation tracking for eng and userdebug builds.

This change will result in a constant increase in memory utilization
per allocation but will help us catch memory errors earlier.
/system/bt/osi/src/allocator.c
4ed68b407ee836df7780a00d6b50b081b334c3ab 30-Aug-2014 Zach Johnson <zachoverflow@google.com> Modify allocation tracking to include and verify the allocation source

This will help detect and prevent allocator alloc/free mismatch.
/system/bt/osi/src/allocator.c
f947fdddf5de6bd30886688a2b399460a3d95ecc 28-Aug-2014 Zach Johnson <zachoverflow@google.com> Add memory canaries and turn them on for unit tests

This will allow us to verify with resonable certainty
that the code is not writing past the end or beginning
of the memory allocation that it was given.

With canaries on, the canaried pointers returned by the
osi alloc functions are no longer passable directly to
free, since they must be offset to get the real allocation
pointers. This means all legacy code must be converted
over to the osi alloc functions before turning canaries
on in the wider codebase.
/system/bt/osi/src/allocator.c
56f3460b37bb8d2c1f2717e7977d5803b80481d1 28-Aug-2014 Zach Johnson <zachoverflow@google.com> Make osi_strdup report allocation size correctly
/system/bt/osi/src/allocator.c
0812fe36ddd585db9f08c725904d14b74714368d 27-Aug-2014 Zach Johnson <zachoverflow@google.com> Add strdup to tracked allocations
/system/bt/osi/src/allocator.c
3b72a14c2515c1169d5501ada5499cf232fc643b 26-Aug-2014 Zach Johnson <zachoverflow@google.com> Implement memory allocation tracker

Provides an interface to track memory allocations, and assert
bad things like double frees don't happen.
/system/bt/osi/src/allocator.c
dcbfea8f812315c93568ef1fccf429fbaa03ce82 16-Aug-2014 Zach Johnson <zachoverflow@google.com> Add an allocator interface + default malloc allocator
/system/bt/osi/src/allocator.c