|
@@ -38,9 +38,9 @@ typedef struct __attribute__((__aligned__(32))) block_header_s {
|
|
|
size_t size; /**< The LSB represents the availability of the block (1
|
|
|
for used, 0 for free), the rest the size of the data
|
|
|
part. */
|
|
|
-#ifdef FUTURE_FEATURES
|
|
|
+#ifdef REQUEST_SIZE_INFO
|
|
|
size_t requested_size; /**< The requested size of the data part */
|
|
|
-#endif /* FUTURE_FEATURES */
|
|
|
+#endif /* REQUEST_SIZE_INFO */
|
|
|
size_t previous_size; /**< The LSB represents the availability of the
|
|
|
previous block, the rest the size of the data
|
|
|
part of the previous block in the memory space */
|
|
@@ -73,7 +73,17 @@ block_header_t * get_header(void *ptr);
|
|
|
*/
|
|
|
size_t get_size(void *ptr);
|
|
|
|
|
|
-#ifdef FUTURE_FEATURES
|
|
|
+#ifdef REQUEST_SIZE_INFO
|
|
|
+
|
|
|
+/**
|
|
|
+ * Set the requested size of memory block's data
|
|
|
+ *
|
|
|
+ * \param ptr The pointer to the data part of the current memory block.
|
|
|
+ * \param size The requested size for the data part of the current memory
|
|
|
+ * block.
|
|
|
+ */
|
|
|
+void set_requested_size(void *ptr, size_t size);
|
|
|
+
|
|
|
/**
|
|
|
* Get the requested size of the memory block's data
|
|
|
*
|
|
@@ -83,7 +93,7 @@ size_t get_size(void *ptr);
|
|
|
* block.
|
|
|
*/
|
|
|
size_t get_requested_size(void *ptr);
|
|
|
-#endif /* FUTURE_FEATURES */
|
|
|
+#endif /* REQUEST_SIZE_INFO */
|
|
|
|
|
|
/**
|
|
|
* Get all information of the memory block header's size record
|
|
@@ -113,17 +123,6 @@ void set_size_and_free(allocator_t *allocator, void *ptr, size_t size);
|
|
|
*/
|
|
|
void set_size_and_used(allocator_t *allocator, void *ptr, size_t size);
|
|
|
|
|
|
-#ifdef FUTURE_FEATURES
|
|
|
-/**
|
|
|
- * Set the requested size of memory block's data
|
|
|
- *
|
|
|
- * \param ptr The pointer to the data part of the current memory block.
|
|
|
- * \param size The requested size for the data part of the current memory
|
|
|
- * block.
|
|
|
- */
|
|
|
-void set_requested_size(void *ptr, size_t size);
|
|
|
-#endif /* FUTURE_FEATURES */
|
|
|
-
|
|
|
/**
|
|
|
* Mark the memory block as used, as well as the previous_size element of the
|
|
|
* next block if there is one.
|