فهرست منبع

Fixed alignment bug after buffer reallocation

Previously if a dynamic back buffer is full and reallocated then the
current allocation alignment will be alignet at the direct memory
address instead of memory address minus size. This is now fixed and
alignment should work correctly.
vurtun 9 سال پیش
والد
کامیت
76ba0b2374
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      nuklear.h

+ 1 - 1
nuklear.h

@@ -4384,7 +4384,7 @@ nk_buffer_alloc(struct nk_buffer *b, enum nk_buffer_allocation_type type,
         /* align newly allocated pointer */
         if (type == NK_BUFFER_FRONT)
             unaligned = nk_ptr_add(void, b->memory.ptr, b->allocated);
-        else unaligned = nk_ptr_add(void, b->memory.ptr, b->size);
+        else unaligned = nk_ptr_add(void, b->memory.ptr, b->size - size);
         memory = nk_buffer_align(unaligned, align, &alignment, type);
     }