summaryrefslogtreecommitdiff
path: root/mallocx.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2023-01-31 22:54:45 +0300
committerIvan Maidanski <ivmai@mail.ru>2023-01-31 23:02:42 +0300
commit31fa843270a83e5e93c8dee16a3654eb93a98833 (patch)
tree67f17e4e375f0d2b2c1ee2dc39b86f207c7fe6de /mallocx.c
parentf6befb64d1d366f18f6d72569e179bfe7d36f4c8 (diff)
downloadbdwgc-31fa843270a83e5e93c8dee16a3654eb93a98833.tar.gz
Better document missing debugging version for aligned allocation routines
* dbg_mlc.c (GC_debug_free): Add TODO item to suppress a GC warning. * include/gc/leak_detector.h (aligned_alloc): Add comment that the debugging version is missing. * mallocx.c (GC_memalign): Add TODO item about the missing debugging version.
Diffstat (limited to 'mallocx.c')
-rw-r--r--mallocx.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/mallocx.c b/mallocx.c
index 47cca9ee..cd0fc527 100644
--- a/mallocx.c
+++ b/mallocx.c
@@ -491,7 +491,15 @@ GC_API GC_ATTR_MALLOC void * GC_CALL GC_malloc_many(size_t lb)
return result;
}
-/* Debug version is tricky and currently missing. */
+/* TODO: The debugging version of GC_memalign and friends is tricky */
+/* and currently missing. There are 2 major difficulties: */
+/* - GC_base() should always point to the beginning of the allocated */
+/* block (thus, for small objects allocation we should probably */
+/* iterate over the list of free objects to find the one with the */
+/* suitable alignment); */
+/* - store_debug_info() should return the pointer of the object with */
+/* the requested alignment (unlike the object header). */
+
GC_API GC_ATTR_MALLOC void * GC_CALL GC_memalign(size_t align, size_t lb)
{
size_t offset;