Changeset 957 for trunk/zoo-project/zoo-kernel/service.c
- Timestamp:
- Feb 6, 2020, 3:12:42 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-kernel/service.c
r955 r957 1829 1829 #endif 1830 1830 #endif 1831 1832 /* 1833 * Dynamically allocate memory for a map value 1834 * 1835 * @param node the map for which the value buffer should be allocated 1836 * @param num_bytes the number of bytes to allocate 1837 * @return pointer to the allocated memory buffer 1838 * 1839 * This function will free, and hence delete, any existing value in the map. 1840 * The memory should be deallocated by calling freeMap. 1841 */ 1842 char* allocateMapValue(map* node, size_t num_bytes) 1843 { 1844 if (node == NULL) { 1845 return NULL; 1846 } 1847 1848 if (node->value != NULL) { 1849 free(node->value); 1850 } 1851 node->value = (char*) malloc(num_bytes); 1852 1853 return node->value; 1854 }
Note: See TracChangeset
for help on using the changeset viewer.