hostap: Reserve the heap

By default (-1) libc uses all the available heap, this is good to
efficiently use the RAM, but for scenarios which there isn't enough RAM
the build will be success, but we see runtime failures.

Reserved the necessary RAM based on tests ahead to catch such scenarios,
of course this would mean that we might be no using full RAM in case
more is left, but that's never the case the with Wi-Fi :).

And this also adds the constant evaluation and fine tuneing like we do
for kernel heap and other parameters.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
diff --git a/modules/hostap/Kconfig b/modules/hostap/Kconfig
index 472857c..0ce291b 100644
--- a/modules/hostap/Kconfig
+++ b/modules/hostap/Kconfig
@@ -16,11 +16,16 @@
 	select NET_L2_WIFI_MGMT
 	select WIFI_NM
 	select EXPERIMENTAL
+	select COMMON_LIBC_MALLOC
 	help
 	  WPA supplicant as a network management backend for WIFI_NM.
 
 if WIFI_NM_WPA_SUPPLICANT
 
+config COMMON_LIBC_MALLOC_ARENA_SIZE
+	# 30K is mandatory, but might need more for long duration use cases
+	default 30000
+
 config WIFI_NM_WPA_SUPPLICANT_THREAD_STACK_SIZE
 	int "Stack size for wpa_supplicant thread"
 	default 8192