- /* check alignment matches first, and if ok, see if we can resize block */
- if (RTE_PTR_ALIGN(ptr,align) == ptr &&
+
+ /* check requested socket id and alignment matches first, and if ok,
+ * see if we can resize block
+ */
+ if ((socket == SOCKET_ID_ANY ||
+ (unsigned int)socket == elem->heap->socket_id) &&
+ RTE_PTR_ALIGN(ptr, align) == ptr &&